public void Login_NotLoggedInUser_ShouldNotTrackLoginEvents(FakeMembershipUser user, [Frozen] IAccountTrackerService accountTrackerService, AuthenticationProvider authenticationProvider, AccountRepository repo) { authenticationProvider.Login(@"somedomain\John", Arg.Any <string>(), Arg.Any <bool>()).Returns(false); var context = new FakeSiteContext(new StringDictionary { { "domain", "somedomain" } }); using (new Switcher <Domain, Domain>(new Domain("somedomain"))) { using (new AuthenticationSwitcher(authenticationProvider)) { repo.Login("John", "somepassword"); accountTrackerService.DidNotReceive().TrackLogin(Arg.Any <string>()); } } }