public void FillCityListTest() { MainWindow_Accessor target = new MainWindow_Accessor(); target.InfoFlightForm_Loaded(target, null); target.FillCityList(); string[] expected = { "Київ", "Лондон", "Париж", "Відень","Москва", "Берлін", "Мюнхен", "Мадрид" }; string[] actual = new string[target.cityList.Items.Count]; for (int i = 0; i < target.cityList.Items.Count; i++) { actual[i] = target.cityList.Items[i].ToString(); Assert.AreEqual(expected[i], actual[i]); } }
public void SelectXTest() { MainWindow_Accessor target = new MainWindow_Accessor(); MainWindow.logUser = 1; target.InfoFlightForm_Loaded(target, null); target.LoadDataMenuItem_Click(target, null); string selCity = "Відень"; List <Flight> expected = new List <Flight>(10); expected.Add(new Flight("КВ-834", "Відень", "13:40", "45")); List <Flight> actual; actual = target.SelectX(selCity); Assert.AreEqual(expected[0].ToString(), actual[0].ToString()); }
public void SelectXYTest() { MainWindow_Accessor target = new MainWindow_Accessor(); MainWindow.logUser = 1; target.InfoFlightForm_Loaded(target, null); DateTime timeFlight = Convert.ToDateTime("10:00"); List <Flight> expected = new List <Flight>(10); expected.Add(new Flight("КВ-834", "Відень", "13:40", "45")); List <Flight> actual; target.selectedCityList.Add(new Flight("КВ-834", "Відень", "13:40", "45")); target.selectedCityList.Add(new Flight("КМ-202", "Відень", "7:35", "32")); actual = target.SelectXY(timeFlight); Assert.AreEqual(expected[0].ToString(), actual[0].ToString()); }