Exemplo n.º 1
0
        public void IncludeWildcard()
        {
            var included = new string[]
            {
                "*.*"
            };
            var excluded = new string[]
            {
            };

            var hostnamePattern = new HostnamePattern(included, excluded);

            Assert.True(hostnamePattern.ValidateHost("example.com"));
        }
Exemplo n.º 2
0
        public void IncludedNoWildcardCaseInsensitive()
        {
            var included = new string[]
            {
                "a.exAmpLe.com",
                "B.example.com"
            };
            var excluded = new string[]
            {
            };

            var hostnamePattern = new HostnamePattern(included, excluded);

            Assert.True(hostnamePattern.ValidateHost("a.exampLe.com"));
            Assert.True(hostnamePattern.ValidateHost("b.eXample.com"));
            Assert.False(hostnamePattern.ValidateHost("c.example.com"));
        }
Exemplo n.º 3
0
        public void IncludeWildcardWithExclusion()
        {
            var included = new string[]
            {
                "*.example.com",
            };
            var excluded = new string[]
            {
                "b.example.com"
            };

            var hostnamePattern = new HostnamePattern(included, excluded);

            Assert.True(hostnamePattern.ValidateHost("example.com"));
            Assert.True(hostnamePattern.ValidateHost("a.example.com"));
            Assert.False(hostnamePattern.ValidateHost("b.example.com"));
            Assert.True(hostnamePattern.ValidateHost("c.example.com"));
        }