public void TestDatePeriodParse() { int year = 2016, month = 11; bool inclusiveEnd = parser.GetInclusiveEndPeriodFlag(); // test basic cases BasicTestFuture("I'll be out from 4 to 22 this month", 4, 22, month, year); BasicTestFuture("I'll be out from 4-23 in next month", 4, 23, 12, year); BasicTestFuture("I'll be out from 3 until 12 of Sept hahaha", 3, 12, 9, year + 1); BasicTestFuture("I'll be out 4 to 23 next month", 4, 23, 12, year); BasicTestFuture("I'll be out 4 till 23 of this month", 4, 23, month, year); BasicTestFuture("I'll be out between 4 and 22 this month", 4, 22, month, year); BasicTestFuture("I'll be out between 3 and 12 of Sept hahaha", 3, 12, 9, year + 1); BasicTestFuture("I'll be out from 4 to 22 January, 1995", 4, 22, 1, 1995); BasicTestFuture("I'll be out between 4-22 January, 1995", 4, 22, 1, 1995); BasicTestFuture("I'll be out between september 4th through september 8th", 4, 8, 9, year + 1); if (inclusiveEnd) { BasicTestFuture("I'll be out on this week", 7, 13, month, year); BasicTestFuture("I'll be out on current week", 7, 13, month, year); BasicTestFuture("I'll be out February", year + 1, 2, 1, year + 1, 2, 28); BasicTestFuture("I'll be out this September", year, 9, 1, year, 9, 30); BasicTestFuture("I'll be out last sept", year - 1, 9, 1, year - 1, 9, 30); BasicTestFuture("I'll be out next june", year + 1, 6, 1, year + 1, 6, 30); BasicTestFuture("I'll be out the third week of this month", 21, 27, month, year); BasicTestFuture("I'll be out the last week of july", year + 1, 7, 24, year + 1, 7, 30); BasicTestFuture("week of september.16th", 11, 17, 9, year + 1); BasicTestFuture("month of september.16th", year, 9, 1, year, 9, 30); } else { BasicTestFuture("I'll be out on this week", 7, 14, month, year); BasicTestFuture("I'll be out on current week", 7, 14, month, year); BasicTestFuture("I'll be out February", year + 1, 2, 1, year + 1, 3, 1); BasicTestFuture("I'll be out this September", year, 9, 1, year, 10, 1); BasicTestFuture("I'll be out last sept", year - 1, 9, 1, year - 1, 10, 1); BasicTestFuture("I'll be out next june", year + 1, 6, 1, year + 1, 7, 1); BasicTestFuture("I'll be out the third week of this month", 21, 28, month, year); BasicTestFuture("I'll be out the last week of july", year + 1, 7, 24, year + 1, 7, 31); BasicTestFuture("week of september.16th", 11, 18, 9, year + 1); BasicTestFuture("month of september.16th", year + 1, 9, 1, year + 1, 10, 1); } if (inclusiveEnd) { BasicTestFuture("I'll be out 2015.3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("I'll be out 2015-3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("I'll be out 2015/3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("I'll be out 3/2015", 2015, 3, 1, 2015, 3, 31); } else { BasicTestFuture("I'll be out 2015.3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("I'll be out 2015-3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("I'll be out 2015/3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("I'll be out 3/2015", 2015, 3, 1, 2015, 4, 1); } }
public void TestDatePeriodParse() { int year = 2016, month = 11; bool inclusiveEnd = parser.GetInclusiveEndPeriodFlag(); //TODO: add tests for week of and month of // test basic cases BasicTestFuture("Estare afuera desde el 4 hasta el 22 de este mes", 4, 22, month, year); BasicTestFuture("Estare afuera desde 4-23 del proximo mes", 4, 23, 12, year); BasicTestFuture("Estare afuera desde el 3 hasta el 12 de Sept jajaja", 3, 12, 9, year + 1); BasicTestFuture("Estare afuera 4 hasta 23 del proximo mes", 4, 23, 12, year); BasicTestFuture("Estare afuera desde el 4 hasta el 23 de este mes", 4, 23, month, year); BasicTestFuture("Estare afuera entre 4 y 22 este mes", 4, 22, month, year); BasicTestFuture("Estare afuera entre el 3 y el 12 de Set jajaja", 3, 12, 9, year + 1); BasicTestFuture("Estare afuera del 4 al 22 de enero, 1995", 4, 22, 1, 1995); BasicTestFuture("Estare afuera entre 4-22 enero, 1995", 4, 22, 1, 1995); if (inclusiveEnd) { BasicTestFuture("Estare afuera esta semana", 7, 13, month, year); BasicTestFuture("Estare afuera en Febrero", year + 1, 2, 1, year + 1, 2, 28); BasicTestFuture("Estare afuera este Septiembre", year, 9, 1, year, 9, 30); BasicTestFuture("Estare afuera el ultimo sept", year - 1, 9, 1, year - 1, 9, 30); BasicTestFuture("Estare afuera el proximo junio", year + 1, 6, 1, year + 1, 6, 30); BasicTestFuture("Estare afuera la tercera semana de este mes", 21, 28, month, year); BasicTestFuture("Estare afuera la ultima semana de julio", year + 1, 7, 24, year + 1, 7, 31); } else { BasicTestFuture("Estare afuera esta semana", 7, 14, month, year); BasicTestFuture("Estare afuera en Febrero", year + 1, 2, 1, year + 1, 3, 1); BasicTestFuture("Estare afuera este Septiembre", year, 9, 1, year, 10, 1); BasicTestFuture("Estare afuera el ultimo sept", year - 1, 9, 1, year - 1, 10, 1); BasicTestFuture("Estare afuera el proximo junio", year + 1, 6, 1, year + 1, 7, 1); BasicTestFuture("Estare afuera la tercera semana de este mes", 21, 28, month, year); BasicTestFuture("Estare afuera la ultima semana de julio", year + 1, 7, 24, year + 1, 7, 31); } // test merging two time points BasicTestFuture("Estare afuera el 2 de Oct hasta 22 de Octubre", 2, 22, 10, year + 1); BasicTestFuture("Estare afuera el 12 de Enero, 2016 - 22/01/2016", 12, 22, 1, year); BasicTestFuture("Estare afuera el 1ro de Ene hasta Mi, 22 de Ene", 1, 22, 1, year + 1); BasicTestFuture("Estare afuera hoy hasta mañana", 7, 8, month, year); BasicTestFuture("Estare afuera desde 2 de Oct hasta 22 de Octubre", 2, 22, 10, year + 1); BasicTestFuture("Estare afuera entre 2 de Oct y 22 de Octubre", 2, 22, 10, year + 1); BasicTestFuture("Estare afuera 19-20 de Noviembre", 19, 20, 11, year); BasicTestFuture("Estare afuera 19 hasta 20 de Noviembre", 19, 20, 11, year); BasicTestFuture("Estare afuera entre 19 y 20 de Noviembre", 19, 20, 11, year); if (inclusiveEnd) { BasicTestFuture("Estare afuera 2015.3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("Estare afuera 2015-3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("Estare afuera 2015/3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("Estare afuera 3/2015", 2015, 3, 1, 2015, 3, 31); } else { BasicTestFuture("Estare afuera 2015.3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("Estare afuera 2015-3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("Estare afuera 2015/3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("Estare afuera 3/2015", 2015, 3, 1, 2015, 4, 1); } //BasicTestFuture("I'll leave this summer", 2016, 6, 1, 2016, 9, 1); //BasicTestFuture("I'll leave in summer", 2017, 6, 1, 2017, 9, 1); //BasicTestFuture("I'll leave in winter", 2016, 12, 1, 2017, 3, 1); //BasicTestFuture("I'll leave in winter, 2017", 2017, 12, 1, 2018, 3, 1); }
public void TestDatePeriodParse() { int year = 2016, month = 11; bool inclusiveEnd = parser.GetInclusiveEndPeriodFlag(); // test basic cases BasicTestFuture("I'll be out from 4 to 22 this month", 4, 22, month, year); BasicTestFuture("I'll be out from 4-23 in next month", 4, 23, 12, year); BasicTestFuture("I'll be out from 3 until 12 of Sept hahaha", 3, 12, 9, year + 1); BasicTestFuture("I'll be out 4 to 23 next month", 4, 23, 12, year); BasicTestFuture("I'll be out 4 till 23 of this month", 4, 23, month, year); BasicTestFuture("I'll be out between 4 and 22 this month", 4, 22, month, year); BasicTestFuture("I'll be out between 3 and 12 of Sept hahaha", 3, 12, 9, year + 1); BasicTestFuture("I'll be out from 4 to 22 January, 1995", 4, 22, 1, 1995); BasicTestFuture("I'll be out between 4-22 January, 1995", 4, 22, 1, 1995); if (inclusiveEnd) { BasicTestFuture("scheduel a meeting in two weeks", 15, 21, month, year); BasicTestFuture("I'll be out on this week", 7, 13, month, year); BasicTestFuture("I'll be out February", year + 1, 2, 1, year + 1, 2, 28); BasicTestFuture("I'll be out this September", year, 9, 1, year, 9, 30); BasicTestFuture("I'll be out last sept", year - 1, 9, 1, year - 1, 9, 30); BasicTestFuture("I'll be out next june", year + 1, 6, 1, year + 1, 6, 30); BasicTestFuture("I'll be out the third week of this month", 21, 27, month, year); BasicTestFuture("I'll be out the last week of july", year + 1, 7, 24, year + 1, 7, 30); } else { BasicTestFuture("scheduel a meeting in two weeks", 15, 22, month, year); BasicTestFuture("I'll be out on this week", 7, 14, month, year); BasicTestFuture("I'll be out February", year + 1, 2, 1, year + 1, 3, 1); BasicTestFuture("I'll be out this September", year, 9, 1, year, 10, 1); BasicTestFuture("I'll be out last sept", year - 1, 9, 1, year - 1, 10, 1); BasicTestFuture("I'll be out next june", year + 1, 6, 1, year + 1, 7, 1); BasicTestFuture("I'll be out the third week of this month", 21, 28, month, year); BasicTestFuture("I'll be out the last week of july", year + 1, 7, 24, year + 1, 7, 31); } // test merging two time points BasicTestFuture("I'll be out Oct. 2 to October 22", 2, 22, 10, year + 1); BasicTestFuture("I'll be out January 12, 2016 - 01/22/2016", 12, 22, 1, year); BasicTestFuture("I'll be out 1st Jan until Wed, 22 of Jan", 1, 22, 1, year + 1); BasicTestFuture("I'll be out today till tomorrow", 7, 8, month, year); BasicTestFuture("I'll be out from Oct. 2 to October 22", 2, 22, 10, year + 1); BasicTestFuture("I'll be out between Oct. 2 and October 22", 2, 22, 10, year + 1); BasicTestFuture("I'll be out November 19-20", 19, 20, 11, year); BasicTestFuture("I'll be out November 19 to 20", 19, 20, 11, year); BasicTestFuture("I'll be out November between 19 and 20", 19, 20, 11, year); if (inclusiveEnd) { BasicTestFuture("I'll be out 2015.3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("I'll be out 2015-3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("I'll be out 2015/3", 2015, 3, 1, 2015, 3, 31); BasicTestFuture("I'll be out 3/2015", 2015, 3, 1, 2015, 3, 31); } else { BasicTestFuture("I'll be out 2015.3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("I'll be out 2015-3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("I'll be out 2015/3", 2015, 3, 1, 2015, 4, 1); BasicTestFuture("I'll be out 3/2015", 2015, 3, 1, 2015, 4, 1); } //BasicTestFuture("I'll leave this summer", 2016, 6, 1, 2016, 9, 1); //BasicTestFuture("I'll leave in summer", 2017, 6, 1, 2017, 9, 1); //BasicTestFuture("I'll leave in winter", 2016, 12, 1, 2017, 3, 1); //BasicTestFuture("I'll leave in winter, 2017", 2017, 12, 1, 2018, 3, 1); }