예제 #1
0
        public void GetFailureHandler_ReturnsCorrectlyTypedInstance()
        {
            var config = new HttpAuthenticationConfigurationSection()
            {
                FailureHandlerFactoryName = typeof(MockConfigFactory).AssemblyQualifiedName
            };

            Assert.IsType <MockFailureHandler>(HttpContextInspectorsLocator.GetFailureHandler(config));
        }
예제 #2
0
        public void GetFailureHandler_ThrowsOnInvalidConfigurationTypeName()
        {
            var config = new HttpAuthenticationConfigurationSection()
            {
                FailureHandlerFactoryName = "GobbledyGook"
            };

            Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.GetFailureHandler(config));
        }
예제 #3
0
        public void GetFailureHandler_ReturnsNullOnNullConfiguration()
        {
            var config = new HttpAuthenticationConfigurationSection();

            Assert.Null(HttpContextInspectorsLocator.GetFailureHandler(config));
        }
예제 #4
0
 public void GetFailureHandler_ThrowsOnNullConfiguration()
 {
     Assert.Throws <ArgumentNullException>(() => HttpContextInspectorsLocator.GetFailureHandler(null));
 }