IsType <T> and IsType (object, object) throwing an IsTypeException
I'm trying to claim that the object returned by the method call is of type List<MyClass> , so using xUnit I tried the following:
var expected = typeof(List<MyClass>); var actual = typeof(method()); Assert.IsType<List<MyClass>>(actual); Assert.IsType(expected, actial); Both of the above throw an IsTypeException , however, if I execute:
var areSameType = expected == actual areSameType - true . So is something going deeper that I donβt take into account?
Docs:
http://www.nudoq.org/#!/Packages/xunit.extensions/xunit.extensions/Assertions/M/IsType(T) http://www.nudoq.org/#!/Packages/xunit.extensions/ xunit.extensions / Assertions / M / IsType
+6