public void Construct_ReturnsCorrectlyTypedInstance() { var config = new AuthenticatorConfigurationElement() { Factory = typeof(MockAuthConfigFactory).AssemblyQualifiedName }; Assert.IsType <MockAuthenticator>(HttpContextInspectorsLocator.Construct(config)); }
public void Construct_ThrowsOnInvalidConfigurationTypeName() { var config = new AuthenticatorConfigurationElement() { Factory = "GobbledyGook" }; Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.Construct(config)); }
public void Resolve_ReturnsExpectedTypeInstance() { var config = new AuthenticatorConfigurationElement() { PrincipalBuilderFactory = typeof(MockPrincipalBuilderFactory).AssemblyQualifiedName }; Assert.IsType(typeof(MockPrincipalBuilder), PrincipalBuilderLocator.Resolve(config)); }
public void Resolve_ReturnsNullOnEmptyFactoryName() { var config = new AuthenticatorConfigurationElement() { PrincipalBuilderFactory = string.Empty }; Assert.Null(PrincipalBuilderLocator.Resolve(config)); }
public void Resolve_ReturnsNullOnEmptyFactoryName() { var config = new AuthenticatorConfigurationElement() { PrincipalBuilderFactory = string.Empty }; Assert.Null(PrincipalBuilderLocator.Resolve(config)); }
public void Resolve_ReturnsExpectedTypeInstance() { var config = new AuthenticatorConfigurationElement() { PrincipalBuilderFactory = typeof(MockPrincipalBuilderFactory).AssemblyQualifiedName }; Assert.IsType(typeof(MockPrincipalBuilder), PrincipalBuilderLocator.Resolve(config)); }