-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
Description
I would expect this:
var response = result.GetType(); // returns ICustomInterface<int>
response.Should().Be(typeof(ICustomInterface<>));
to succeed.
Instead it fails with message:
Expected type to be ICustomInterface1, but found ICustomInterface1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].
I believe this is related to the change made for: #458
P.S. Workaround for now:
result.GetType().GetGenericTypeDefinition()
.Should().Be(typeof(ICustomInterface<>));
I am also using this in a few "And" constraints which forces me to do:
result.Should().NotBeNull()
.And.Subject.GetGenericTypeDefinition().Should().Be(typeof(ICustomInterface<>));
Which is ugly and stops me being able to add more assertions as the Subject is now the GenericTypeDefinition and not the actual Type I am validating.