Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }