Exemplo n.º 1
0
        public void GetFailureHandler_ReturnsCorrectlyTypedInstance()
        {
            var config = new HttpAuthenticationConfigurationSection()
            {
                FailureHandlerFactoryName = typeof(MockConfigFactory).AssemblyQualifiedName
            };

            Assert.IsType <MockFailureHandler>(HttpContextInspectorsLocator.GetFailureHandler(config));
        }
Exemplo n.º 2
0
        public void Construct_ReturnsCorrectlyTypedInstance()
        {
            var config = new AuthenticatorConfigurationElement()
            {
                Factory = typeof(MockAuthConfigFactory).AssemblyQualifiedName
            };

            Assert.IsType <MockAuthenticator>(HttpContextInspectorsLocator.Construct(config));
        }
Exemplo n.º 3
0
        public void GetFailureHandler_ThrowsOnInvalidConfigurationTypeName()
        {
            var config = new HttpAuthenticationConfigurationSection()
            {
                FailureHandlerFactoryName = "GobbledyGook"
            };

            Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.GetFailureHandler(config));
        }
Exemplo n.º 4
0
        public void Construct_ThrowsOnInvalidConfigurationTypeName()
        {
            var config = new AuthenticatorConfigurationElement()
            {
                Factory = "GobbledyGook"
            };

            Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.Construct(config));
        }
Exemplo n.º 5
0
        public void GetFailureHandler_ReturnsNullOnNullConfiguration()
        {
            var config = new HttpAuthenticationConfigurationSection();

            Assert.Null(HttpContextInspectorsLocator.GetFailureHandler(config));
        }
Exemplo n.º 6
0
 public void GetFailureHandler_ThrowsOnNullConfiguration()
 {
     Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.GetFailureHandler(null));
 }
Exemplo n.º 7
0
 public void Construct_ThrowsOnNullInspectors()
 {
     Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.Construct(null as IDictionary <string, AuthenticatorConfigurationElement>));
 }
Exemplo n.º 8
0
 public void Construct_ThrowsOnNullConfiguration()
 {
     Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.Construct(null as AuthenticatorConfigurationElement));
 }