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
If I'm extending the fluent asertions library with some extension methods, it would be nice to be able to iterate through the underlying IMonitor<> of the EventAssertions<> class.
A Pseudo example:
publicclassFixture{publicvoidTest(){//Arrange varparameter="Hello";varsut=new MyService();usingvarmonitor= sut.Monitor();//Act
sut.DoTheThing();//Assert
monitor
.Should().NotRaiseMyEventWithParameter(parameter);}}publicstaticclassMyExtension{publicstatic IEventRecording NotRaiseMyEventWithParameter<T>(thisEventAssertions<T>assertion,stringparameter){// Monitor not exposed in the EventAssertions!!!!!varrecordings= assertion.**Monitor**.GetRecordingFor(nameof(IMyInterface.MyEvent));//Do the assertion here}}
It is possible to make the extensions method directly on the monitor object, but then the Should() method is not invoked, and semantically it does not fit in with the fluent interface structure.
If I'm extending the fluent asertions library with some extension methods, it would be nice to be able to iterate through the underlying
IMonitor<>
of theEventAssertions<>
class.A Pseudo example:
It is possible to make the extensions method directly on the monitor object, but then the
Should()
method is not invoked, and semantically it does not fit in with the fluent interface structure.The text was updated successfully, but these errors were encountered: