public void TestValidUserMasks() { var valid = new string[] { }; foreach (var host in valid) { Assert.Equal(host, SourceTextParser.Parse(host)); Assert.Equal(host, HostNameTextParser.Parse(host)); } }
public void TestInvalidHostNames() { var invalid = new string[] { "noInvalidCharacters!", "-mustStartWithLetterOrDigit", "noTwoDots.." }; foreach (var host in invalid) { Assert.Throws <ParseException>( () => SourceTextParser.Parse(host) ); } }
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)); } }
public ChapterService(SourceTextParser sourceTextParser, SentenceParser sentenceParser) { _sourceTextParser = sourceTextParser; _sentenceParser = sentenceParser; }