コード例 #1
0
        public void InnerFilter_ReturnsSpecifiedInstance()
        {
            // Arrange
            IAuthenticationFilter       expectedInnerFilter = CreateDummyFilter();
            HostAuthenticationAttribute product             = CreateProductUnderTest(expectedInnerFilter);

            // Act
            IAuthenticationFilter innerFilter = product.InnerFilter;

            // Assert
            Assert.Same(expectedInnerFilter, innerFilter);
        }
コード例 #2
0
        public void AuthenticationType_IsSpecifiedInstance_WhenUsingConstructorWithString()
        {
            // Arrange
            string expectedAuthenticationType   = "Ignore";
            HostAuthenticationAttribute product = CreateProductUnderTest(expectedAuthenticationType);

            // Act
            string authenticationType = product.AuthenticationType;

            // Assert
            Assert.Same(expectedAuthenticationType, authenticationType);
        }
コード例 #3
0
        public void InnerFilter_IsHostAuthenticationFilter_WhenUsingConstructorWithString()
        {
            // Arrange
            string expectedAuthenticationType   = "Ignore";
            HostAuthenticationAttribute product = CreateProductUnderTest(expectedAuthenticationType);

            // Act
            IAuthenticationFilter innerFilter = product.InnerFilter;

            // Assert
            HostAuthenticationFilter typedInnerFilter = Assert.IsType <HostAuthenticationFilter>(innerFilter);

            Assert.Same(expectedAuthenticationType, typedInnerFilter.AuthenticationType);
        }
コード例 #4
0
 // Summary:
 //     Initializes a new instance of the System.Web.Http.HostAuthenticationAttribute
 //     class.
 //
 // Parameters:
 //   authenticationType:
 //     The authentication type of the OWIN middleware to use.
 public SkillsmartHostAuth(string authenticationType)
 {
     haa = new HostAuthenticationAttribute(authenticationType);
 }