Exemplo n.º 1
0
        public void ShouldGetCitiesStartsWithSpecifiedLetter()
        {
            CityListManager listManager = new CityListManager();

            string path = @"..//..//adhed//CityTrainingTwo//Files//cities.txt";
            listManager.LoadElements(path);

            List<City> listWithZ = listManager.GetCitiesStartsWithLetter("Z");

            Assert.AreEqual(listWithZ.Count, 2);
        }
Exemplo n.º 2
0
        public void ShouldGetCitiesStartsWithSpecifiedLetter()
        {
            CityListManager listManager = new CityListManager();

            string path = @"..//..//adhed//CityTrainingTwo//Files//cities.txt";

            listManager.LoadElements(path);

            List <City> listWithZ = listManager.GetCitiesStartsWithLetter("Z");

            Assert.AreEqual(listWithZ.Count, 2);
        }
Exemplo n.º 3
0
        public void ShouldLoadTheCitiesFromTxtFile()
        {
            GenericListManager <City> listManager = new CityListManager();

            string path = @"..//..//adhed//CityTrainingTwo//Files//cities.txt";

            listManager.LoadElements(path);

            List <City> list = listManager.GetList();

            bool result = listManager.CheckElementExists("Pieszyce");

            Assert.IsTrue(result);
        }
Exemplo n.º 4
0
        public void ShouldRemoveCityFromList()
        {
            CityListManager listManager = new CityListManager();

            string path = @"..//..//adhed//CityTrainingTwo//Files//cities.txt";

            listManager.LoadElements(path);

            var result1 = listManager.CheckElementExists("Karpacz");

            listManager.RemoveElement("Karpacz");

            var result2 = listManager.CheckElementExists("Karpacz");

            Assert.IsFalse(result2);
        }
Exemplo n.º 5
0
        public void ShouldRemoveCityFromList()
        {
            CityListManager listManager = new CityListManager();

            string path = @"..//..//adhed//CityTrainingTwo//Files//cities.txt";
            listManager.LoadElements(path);

            var result1 = listManager.CheckElementExists("Karpacz");

            listManager.RemoveElement("Karpacz");

            var result2 = listManager.CheckElementExists("Karpacz");

            Assert.IsFalse(result2);
        }
Exemplo n.º 6
0
        public void ShouldLoadTheCitiesFromTxtFile()
        {
            GenericListManager<City> listManager = new CityListManager();

            string path = @"..//..//adhed//CityTrainingTwo//Files//cities.txt";
            listManager.LoadElements(path);

            List<City> list = listManager.GetList();

            bool result = listManager.CheckElementExists("Pieszyce");

            Assert.IsTrue(result);
        }