Last active
August 11, 2017 14:31
-
-
Save dennisdoomen/e7c673b1be6920a19bd6bcf3e6def94a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Option 1 | |
var subject = new EventRaisingClass(); | |
using (var scope = subject.Monitor()) | |
{ | |
subject.ShouldRaise("NonExistingEvent"); | |
} | |
// Option 2 | |
var subject = new EventRaisingClass(); | |
using (Monitor<EventRaisingClass> monitoredSubject = subject.Monitor() | |
{ | |
monitoredSubject.Should().Raise("NonExistingEvent"); | |
} | |
// Alternative names for Monitor extension method: TrackEvents, MonitorForEvents | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Option 2