You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NSubstitute supports substituting delegates. However, delegates are not resolved as substitutes when using a fixture with the NSubstitute customization. Therefore, I can't run any NSubstitute assertions on them.
[Test]
public void ActionIsSubstitute()
{
var fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
var action = fixture.Create<Action>();
Assert.That(action.DidNotReceive, Throws.Nothing);
}
Fails with:
Expected: No Exception to be thrown
But was: <NSubstitute.Exceptions.NotASubstituteException: NSubstitute extension methods like .Received() can only be called on objects created using Substitute.For() and related methods.
I just realized the property GenerateDelegates already exists on AutoNSubstituteCustomization. Setting that to true resolved my issue. My apologies. I'm new to AutoFixture and couldn't find any documentation on this. Should have checked after I saw how it was resolved for the other issue.
NSubstitute supports substituting delegates. However, delegates are not resolved as substitutes when using a fixture with the NSubstitute customization. Therefore, I can't run any NSubstitute assertions on them.
Fails with:
Similar to #984.
The text was updated successfully, but these errors were encountered: