Esempio n. 1
0
        public void TestValidUserMasks()
        {
            var valid = new string[]
            {
            };

            foreach (var host in valid)
            {
                Assert.Equal(host, SourceTextParser.Parse(host));
                Assert.Equal(host, HostNameTextParser.Parse(host));
            }
        }
Esempio n. 2
0
        public void TestInvalidHostNames()
        {
            var invalid = new string[]
            {
                "noInvalidCharacters!",
                "-mustStartWithLetterOrDigit",
                "noTwoDots.."
            };

            foreach (var host in invalid)
            {
                Assert.Throws <ParseException>(
                    () => SourceTextParser.Parse(host)
                    );
            }
        }
Esempio n. 3
0
        public void TestValidHostNames()
        {
            var valid = new string[]
            {
                "domain",
                "domain.tld",
                "sub.domain.tld",
                "p90.also.valid",
                "also.with-dash.tld"
            };

            foreach (var host in valid)
            {
                Assert.Equal(host, SourceTextParser.Parse(host));
                Assert.Equal(host, HostNameTextParser.Parse(host));
            }
        }
Esempio n. 4
0
 public ChapterService(SourceTextParser sourceTextParser, SentenceParser sentenceParser)
 {
     _sourceTextParser = sourceTextParser;
     _sentenceParser   = sentenceParser;
 }