예제 #1
0
        public void TestFindOldestDateOptimized()
        {
            Assert.IsNull(NormalizationUtils.FindOldestDateOptimized(null), "The extracted date should be null because the input text is null");
            Assert.IsNull(NormalizationUtils.FindOldestDateOptimized("	[email protected]    2000021 	[email protected]    2000210	[email protected]    2000-0-10     "), "The extracted date should be null because the input text is invalid");
            Assert.IsNull(NormalizationUtils.FindOldestDateOptimized("20020229"), "The extracted date should be null because the input date is invalid");

            Assert.AreEqual("2000-02-10", NormalizationUtils.FindOldestDateOptimized("	[email protected]    20000210  "), "The extracted date should be 2000-02-10");
            Assert.AreEqual("2005-02-05", NormalizationUtils.FindOldestDateOptimized("[email protected] 20010724 [email protected] 20011024 [email protected] 20020805 [email protected] 20040503 [email protected] 20041229 [email protected] 20050205"), "The extracted date should be 2005-02-05");
            Assert.AreEqual("1987-07-08", NormalizationUtils.FindOldestDateOptimized("1987-07-08"), "The extracted date should be 1987-07-08");
            Assert.AreEqual("2004-12-14", NormalizationUtils.FindOldestDateOptimized("rfuller @nla.gov.au 20030521 hm - [email protected] 20040906 hm - [email protected] 20041214"), "The extracted date should be 2004-12-14");
        }