Exemplo n.º 1
0
        public void TestTokenMatcherCoCa()
        {
            var template = ReadTemplate("whois.co.ca");
            var input    = ReadData("available.co.ca");

            var matcher = new TokenMatcher();

            matcher.RegisterTemplate(template);

            var match = matcher.Match(input);

            Assert.AreEqual(match.BestMatch.First("DomainName"), "u34jedzcq.co.ca");
            Assert.AreEqual(match.BestMatch.First("Status"), "NotFound");
        }
Exemplo n.º 2
0
        public void TestParseOnePattern()
        {
            matcher.RegisterTemplate("Name: {Person.Name}", "Person");

            var result = matcher.Match <Person>("Name: Alice");

            var person = result.BestMatch.Value;

            Assert.AreEqual("Alice", person.Name);
        }