public void DomainContextType() { string mockType = typeof(AuthenticationDomainContext).FullName; MockWebAuthenticationService service = new MockWebAuthenticationService(); service.DomainContextType = typeof(AuthenticationDomainContext).AssemblyQualifiedName; WebAuthenticationServiceTest.InitializeService(service); Assert.IsInstanceOfType(service.DomainContext, typeof(AuthenticationDomainContext), "DomainContext should be a MockDomainContext."); service = new MockWebAuthenticationService(); ExceptionHelper.ExpectException <InvalidOperationException>( () => WebAuthenticationServiceTest.InitializeService(service)); }
public void DomainContext() { AuthenticationDomainContext mock = new AuthenticationDomainContext(); MockWebAuthenticationService service = new MockWebAuthenticationService(); service.DomainContext = mock; Assert.AreEqual(mock, service.DomainContext, "DomainContexts should be equal."); WebAuthenticationServiceTest.InitializeService(service); Assert.AreEqual(mock, service.DomainContext, "DomainContexts should be equal."); ExceptionHelper.ExpectException <InvalidOperationException>( () => service.DomainContext = null); }