ShouldBeOfType is the inverse of ShouldNotBeOfType.
ShouldBeOfType
ShouldNotBeOfType
var theSimpsonsDog = new Cat { Name = "Santas little helper" }; theSimpsonsDog.ShouldBeOfType<Dog>();
snippet source | anchor
Exception
theSimpsonsDog should be of type Simpsons.Dog but was Simpsons.Cat
var theSimpsonsDog = new Cat { Name = "Santas little helper" }; theSimpsonsDog.ShouldNotBeOfType<Cat>();
theSimpsonsDog should not be of type Simpsons.Cat but was Santas little helper
Last updated 1 year ago