public void EmptyFile() { try { string fileName = "_Test_EmptyFile.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); } catch (Exception e) { Assert.AreEqual(e.Message, "Empty file!"); } }
public void CheckCorrectPath_RoadToCity_StraightWay() { List <string> test = new List <string>() { "СПб", "Москва" }; string fileName = "_Test_Example.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); Assert.AreEqual(test.SequenceEqual(algTest.Path("СПб", "Москва")), true); }
public void NotEnoughArgumentsInFile() { try { string fileName = "_Test_NotEnoughArguments.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); } catch (Exception e) { Assert.AreEqual(e.Message, "Invalid file filling format! On 1 line; one of the arguments is an empty string!"); } }
public void IncorrectPathFormat_Range() { try { string fileName = "_Test_IncorrectPathFormat_Range.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); } catch (Exception e) { Assert.AreEqual(e.Message, "Invalid file filling format! On 1 line; 3 argument (not number)"); } }
public void CheckCorrectPath_RoadToCity_ManyPoints() { List <string> test = new List <string>() { "Москва", "СПб", "Владивосток" }; string fileName = "_Test_Example.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); Assert.AreEqual(test.SequenceEqual(algTest.Path("Москва", "Владивосток")), true); }
public void CheckCities() { List <string> test = new List <string>() { "СПб", "Москва", "Хабаровск", "Владивосток" }; string fileName = "_Test_Example.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); Assert.AreEqual(test.SequenceEqual(algTest.cities), true); }
public void CheckCorrectPath_IncorrectNameCity() { try { string fileName = "_Test_Example.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); algTest.Path("Москва", "Сельдерей"); } catch (Exception e) { Assert.AreEqual(e.Message, "You entered incorrect name of second city!"); } }
public void CheckCorrectPath_NoWay() { try { string fileName = "_Test_NoWay.txt"; Lab3.Floyd_Warshall algTest = new Floyd_Warshall(fileName); var testtt = algTest.Path("1", "2"); } catch (Exception e) { Assert.AreEqual(e.Message, "There is no way!"); } }