private static PassiveAuthenticationMessageHandler CreateProductUnderTest(HttpMessageHandler innerHandler)
        {
            PassiveAuthenticationMessageHandler handler = new PassiveAuthenticationMessageHandler();

            handler.InnerHandler = innerHandler;
            return(handler);
        }
Exemplo n.º 2
0
        private static PassiveAuthenticationMessageHandler CreateProductUnderTest(
            IHostPrincipalService principalService, HttpMessageHandler innerHandler)
        {
            PassiveAuthenticationMessageHandler handler = new PassiveAuthenticationMessageHandler(principalService);

            handler.InnerHandler = innerHandler;
            return(handler);
        }
Exemplo n.º 3
0
        public void ConstructorWithPrincipalService_SetsPrincipalService()
        {
            // Arrange
            IHostPrincipalService expectedPrincipalService = CreateDummyPrincipalService();
            PassiveAuthenticationMessageHandler handler    = new PassiveAuthenticationMessageHandler(
                expectedPrincipalService);

            // Act
            IHostPrincipalService principalService = handler.HostPrincipalService;

            // Assert
            Assert.Same(expectedPrincipalService, principalService);
        }
        public void ConstructorWithPrincipalService_SetsPrincipalService()
        {
            // Arrange
            IHostPrincipalService expectedPrincipalService = CreateDummyPrincipalService();
            PassiveAuthenticationMessageHandler handler = new PassiveAuthenticationMessageHandler(
                expectedPrincipalService);

            // Act
            IHostPrincipalService principalService = handler.HostPrincipalService;

            // Assert
            Assert.Same(expectedPrincipalService, principalService);
        }
Exemplo n.º 5
0
        public void ConstructorWithConfiguration_SetsPrincipalService()
        {
            // Arrange
            IHostPrincipalService expectedPrincipalService = CreateDummyPrincipalService();

            IHostPrincipalService principalService;

            using (HttpConfiguration configuration = new HttpConfiguration())
            {
                configuration.Services.Replace(typeof(IHostPrincipalService), expectedPrincipalService);
                PassiveAuthenticationMessageHandler handler = new PassiveAuthenticationMessageHandler(configuration);

                // Act
                principalService = handler.HostPrincipalService;
            }

            // Assert
            Assert.Same(expectedPrincipalService, principalService);
        }
        public void ConstructorWithConfiguration_SetsPrincipalService()
        {
            // Arrange
            IHostPrincipalService expectedPrincipalService = CreateDummyPrincipalService();

            IHostPrincipalService principalService;

            using (HttpConfiguration configuration = new HttpConfiguration())
            {
                configuration.Services.Replace(typeof(IHostPrincipalService), expectedPrincipalService);
                PassiveAuthenticationMessageHandler handler = new PassiveAuthenticationMessageHandler(configuration);

                // Act
                principalService = handler.HostPrincipalService;
            }

            // Assert
            Assert.Same(expectedPrincipalService, principalService);
        }
 private static PassiveAuthenticationMessageHandler CreateProductUnderTest(HttpMessageHandler innerHandler)
 {
     PassiveAuthenticationMessageHandler handler = new PassiveAuthenticationMessageHandler();
     handler.InnerHandler = innerHandler;
     return handler;
 }
 private static PassiveAuthenticationMessageHandler CreateProductUnderTest(
     IHostPrincipalService principalService, HttpMessageHandler innerHandler)
 {
     PassiveAuthenticationMessageHandler handler = new PassiveAuthenticationMessageHandler(principalService);
     handler.InnerHandler = innerHandler;
     return handler;
 }