예제 #1
0
        public void BasicTest(string text, DateObject date)
        {
            var er = extractor.Extract(text);

            Assert.AreEqual(1, er.Count);
            var pr = parser.Parse(er[0]);

            Assert.AreEqual(Constants.SYS_DATETIME_TIME, pr.Type);
            Assert.AreEqual(date, ((DTParseResult)pr.Value).FutureValue);
        }
예제 #2
0
        public void BasicTest(string text, DateObject date)
        {
            var er = extractor.Extract(text);

            Assert.AreEqual(1, er.Count);
            var pr = parser.Parse(er[0]);

            Assert.AreEqual(Constants.SYS_DATETIME_TIME, pr.Type);
            Assert.AreEqual(date, ((DateTimeResolutionResult)pr.Value).FutureValue);
            TestWriter.Write(TestCulture.English, parser, text, pr);
        }
예제 #3
0
        public void BasicTest(string text, int start, int length)
        {
            var results = extractor.Extract(text);

            Assert.AreEqual(1, results.Count);
            Assert.AreEqual(start, results[0].Start);
            Assert.AreEqual(length, results[0].Length);
            Assert.AreEqual(Constants.SYS_DATETIME_TIME, results[0].Type);
        }
예제 #4
0
        public void BasicTest(string text, int start, int length, int expected = 1)
        {
            var results = extractor.Extract(text);

            Assert.AreEqual(expected, results.Count);

            if (expected < 1)
            {
                return;
            }

            Assert.AreEqual(start, results[0].Start);
            Assert.AreEqual(length, results[0].Length);
            Assert.AreEqual(Constants.SYS_DATETIME_TIME, results[0].Type);
        }