public void ExtractDateFromDayStringItemSuccessTest() { var dayStringItem = "Data Zajęć: 2019-10-04 piątek 17:30 19:00 2h00m dr Name Surname Advanced Math Wyk W/1/Web F Toronto Egzamin 19:15 20:45 2h00m doc. dr John Smiths Modern History of Poland Wyk W/1/Web F Praga Egzamin"; var result = PdfParser.ExtractDateFromDayStringItem(dayStringItem); Assert.AreEqual("Data Zajęć: 2019-10-04 piątek", result); }
public void ExtractDateFromStringItemNotSuccessfulTest2() { var dayStringItem = " Data Zajęć: 2019-10-04 piątek 17:30 19:00 2h00m dr Name Surname Advanced Math Wyk W/1/Web F Toronto Egzamin 19:15 20:45 2h00m doc. dr John Smiths Modern History of Poland Wyk W/1/Web F Praga Egzamin"; var exception = Assert.Throws <ParsingException>(() => { PdfParser.ExtractDateFromDayStringItem(dayStringItem); }); Assert.That(exception.Message, Is.EqualTo(ParsingException.IndexOfMatchedItemNotZero)); }