-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
Description
I would expect this:
var response = controller.Get(); // returns OkNegotiatedContentResult<f_AnonymousType()`1>
response.Should().BeOfType(typeof(OkNegotiatedContentResult<>));to succeed.
Instead it fails with message:
Expected type to be System.Web.Http.Results.OkNegotiatedContentResult
1, but found System.Web.Http.Results.OkNegotiatedContentResult1[[<>f__AnonymousType0`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], MyProject, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].
Is it something you could enhance, please?
P.S. Workaround for now:
response.GetType().GetGenericTypeDefinition()
.Should().Be(typeof(OkNegotiatedContentResult<>));