public void TestReadEGNsFromFileFileNotFoundException() { string actualText = EGNExtractor_Accessor.ReadEGNsFromFile("Go6o.txt"); Assert.Fail("If there is no such file for read" + " method should throw FileNotFoundException!"); }
public void TestExtractAllEGNsEmptyText() { string text = String.Empty; List <string> expected = new List <string>() { }; List <string> actual = EGNExtractor_Accessor.ExtractAllEGNs(text); CollectionAssert.AreEqual(expected, actual, "There is a problem in extracting all EGNs from text!"); }
public void TestExtractAllEGNsWithEGNsPartOfSubstring() { string text = "I am bay Ivan and my personal ID number is 4806" + " and my phone number is0896296263!"; List <string> expected = new List <string>() { }; List <string> actual = EGNExtractor_Accessor.ExtractAllEGNs(text); CollectionAssert.AreEqual(expected, actual, "There is a problem in extracting all EGNs from text!"); }
public void TestExtractAllEGNsTooLongEGNsAndDifferentNumbers() { string text = "I am bay Ivan and my personal ID number is 48061829062" + " and my phone number is 08962962653!"; List <string> expected = new List <string>() { }; List <string> actual = EGNExtractor_Accessor.ExtractAllEGNs(text); CollectionAssert.AreEqual(expected, actual, "There is a problem in extracting all EGNs from text!"); }
public void TestExtractAllEGNsNormalCase() { string text = "I am bay Ivan and my personal ID number is 4806182906!"; List <string> expected = new List <string>() { "4806182906" }; List <string> actual = EGNExtractor_Accessor.ExtractAllEGNs(text); CollectionAssert.AreEqual(expected, actual, "There is a problem in extracting all EGNs from text!"); }
public void TestReadEGNsFromFile() { string inputFileName = Path.GetTempFileName(); string textForWrite = "I am bay Ivan and my personal ID number is 4806182906!"; WriteTextToFile(inputFileName, textForWrite); string expectedText = textForWrite; string actualText = EGNExtractor_Accessor.ReadEGNsFromFile(inputFileName); Assert.AreEqual <string>(expectedText, actualText, "There is a problem reading the file!"); }
public void TestExtractAllEGNsFor3CorrectEGNs() { string text = "I am bay Ivan and my personal ID number is 4806484852" + " and my phone number is 0896296265!"; List <string> expected = new List <string>() { "4806484852", "0896296265" }; List <string> actual = EGNExtractor_Accessor.ExtractAllEGNs(text); CollectionAssert.AreEqual(expected, actual, "There is a problem in extracting all EGNs from text!"); }