ShouldBeOfType
is the inverse of ShouldNotBeOfType
.
var theSimpsonsDog = new Cat { Name = "Santas little helper" };theSimpsonsDog.ShouldBeOfType<Dog>();
Exception
theSimpsonsDogshould be of typeSimpsons.Dogbut wasSimpsons.Cat
var theSimpsonsDog = new Cat { Name = "Santas little helper" };theSimpsonsDog.ShouldNotBeOfType<Cat>();
Exception
theSimpsonsDogshould not be of typeSimpsons.Catbut wasSantas little helper