public async Task WeatherListIsNotEmpty() { //Arrange MockWeather mockWeather = new MockWeather(); var homePageVM = new HomePageViewModel(mockWeather, _eventAggregator, _townsRepository); //Act await homePageVM.UpdateTownList(); //Assert Assert.IsNotEmpty(homePageVM.WeatherList); }
public async Task Search_ShouldBeTula() { //Arrange MockWeather mockWeather = new MockWeather(); var homePageVM = new HomePageViewModel(mockWeather, _eventAggregator, _townsRepository); //Act await homePageVM.UpdateTownList(); await homePageVM.Search("Tula"); //Check wether town "Tula" had been found and automaticly choosen Assert.AreEqual("Tula", homePageVM.SelectedTown.TownName); }
public async Task FirstSelectedTown_ShouldBeMoscow() { //Arrange MockWeather mockWeather = new MockWeather(); var homePageVM = new HomePageViewModel(mockWeather, _eventAggregator, _townsRepository); //Act await homePageVM.UpdateTownList(); //Assert var townFromWeatherList = homePageVM.WeatherList.FirstOrDefault(); Assert.AreEqual(townFromWeatherList.TownName, homePageVM.SelectedTown.TownName); }