public void GivenCallback_WhenInitialize_ThenCallbackSet() { var expected = new Action(GivenCallback_WhenInitialize_ThenCallbackSet); AuthenticationModuleProvider.Initialize(expected); Assert.AreEqual(expected, AuthenticationModuleProvider.SignedInCallback); }
public void GivenCallback_AndDifferentCallbackRegistered_WhenInitialize_ThenCallbackSet() { var expected = new Action(GivenCallback_WhenInitialize_ThenCallbackSet); AuthenticationModuleProvider.Initialize(new Action(() => { })); AuthenticationModuleProvider.Initialize(expected); Assert.AreEqual(expected, AuthenticationModuleProvider.SignedInCallback); }
public void GivenAuthenticationModuleProviderInitializedWithCallback_WhenOnSignedIn_ThenCallbackInvoked() { bool wasCalled = false; AuthenticationModuleProvider.Initialize(new Action(() => wasCalled = true)); TestTarget target = new TestTarget(); target.CallOnSignedIn(); Assert.IsTrue(wasCalled); }