Search
“authservice”
More pages from the web
1–1 of 1-
hammond-turner.org.uk/blog/nuggets
Golden Nuggets
Golden Nuggets Thursday, May', 2011 Thursday Quickie - Mocking Events with Moq There are times when the code under test depends on an event being fired by a component we're mocking. You can explicitly fire a mocked object's event using the following code var authService = new Mock(); authService.Raise(m => m.LoggedIn += null, null as AuthenticationEventArgs); You can also raise an event on the mock as part of a callback - i.e. fire the event when a method or
