コード例 #1
0
        public void ShouldCountCities()
        {
            CityListManager listManager = new CityListManager();

            var city1 = new City("Karpacz");
            var city2 = new City("Wieleń");

            listManager.AddElement(city1);
            listManager.AddElement(city2);

            var result = listManager.CountElements();

            Assert.AreEqual(result, 2);
        }
コード例 #2
0
        public void ShouldCountCities()
        {
            CityListManager listManager = new CityListManager();

            var city1 = new City("Karpacz");
            var city2 = new City("Wieleń");

            listManager.AddElement(city1);
            listManager.AddElement(city2);

            var result = listManager.CountElements();

            Assert.AreEqual(result, 2);
        }
コード例 #3
0
        public void ShouldRemoveDuplicates()
        {
            CityListManager listManager = new CityListManager();

            var city1 = new City("Karpacz");
            var city2 = new City("Wieleń");
            var city3 = new City("Warszawa");
            var city4 = new City("Karpacz");
            var city5 = new City("Wieleń");

            listManager.AddElement(city1);
            listManager.AddElement(city2);
            listManager.AddElement(city3);
            listManager.AddElement(city4);
            listManager.AddElement(city5);

            var result1 = listManager.CountElements();

            listManager.RemoveDuplicates(new CitiesComparer());

            var result2 = listManager.CountElements();

            Assert.AreEqual(result2, 3);
        }
コード例 #4
0
        public void ShouldRemoveDuplicates()
        {
            CityListManager listManager = new CityListManager();

            var city1 = new City("Karpacz");
            var city2 = new City("Wieleń");
            var city3 = new City("Warszawa");
            var city4 = new City("Karpacz");
            var city5 = new City("Wieleń");

            listManager.AddElement(city1);
            listManager.AddElement(city2);
            listManager.AddElement(city3);
            listManager.AddElement(city4);
            listManager.AddElement(city5);

            var result1 = listManager.CountElements();

            listManager.RemoveDuplicates(new CitiesComparer());

            var result2 = listManager.CountElements();

            Assert.AreEqual(result2, 3);
        }