Ejemplo n.º 1
0
        public void BasicTest(string text, DateObject beginDate, DateObject endDate)
        {
            var er = extractor.Extract(text);

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

            Assert.AreEqual(Constants.SYS_DATETIME_TIMEPERIOD, pr.Type);
            Assert.AreEqual(beginDate, ((Tuple <DateObject, DateObject>)((DateTimeResolutionResult)pr.Value).FutureValue).Item1);
            Assert.AreEqual(endDate, ((Tuple <DateObject, DateObject>)((DateTimeResolutionResult)pr.Value).FutureValue).Item2);
        }
        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_TIMEPERIOD, results[0].Type);
        }