Beispiel #1
0
        public void EditCitySuccess_When_data_is_real()
        {
            // Arrange
            controller = new FavoriteCitiesController(unitOfWork);
            var city = new CityModel {
                Id = 2, Name = "Lviv"
            };

            // Act
            var result = controller.Edit(city) as RedirectToRouteResult;

            // Assert
            Assert.AreEqual("Index", result.RouteValues["action"]);
        }
Beispiel #2
0
        public void EditCitySuccess_When_input_data_is_correct()
        {
            // Arrange
            controller = new FavoriteCitiesController(mockUnitOfWork.Object);
            var city = new CityModel {
                Id = 1, Name = "Las Vegas"
            };

            // Act
            var result = controller.Edit(city) as RedirectToRouteResult;

            // Assert
            Assert.AreEqual("Index", result.RouteValues["action"]);
            mockUnitOfWork.Verify(i => i.CityRepository.Update(It.IsAny <Database.Entities.City>()), Times.AtLeastOnce);
        }