-
Notifications
You must be signed in to change notification settings - Fork 8
Type expectations
Davyd McColl edited this page Oct 14, 2017
·
2 revisions
You can test the type of an object:
Expect(obj).To.Be.An.Instance.Of<IInterface>();
Expect(obj).To.Be.An.Instance.Of<BaseClass>();
Often I find I want to do this testing before I'm even writing tests with constructed SUT objects, for example, I want a test which shows that I intend to implement an interface or inherit from a base class:
var sut = typeof(SomeClass);
Expect(sut).To.Implement<IInterface>();
Expect(sut).To.Inherit<BaseClass>();