Esempio n. 1
0
 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!");
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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!");
     }
 }
Esempio n. 4
0
 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)");
     }
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 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!");
     }
 }
Esempio n. 8
0
        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!");
            }
        }