Exemple #1
0
        public void DeleteCitySuccess_When_data_is_real()
        {
            // Arrange
            controller = new FavoriteCitiesController(unitOfWork);
            var cityId = 6;

            // Act
            var result = controller.DeletePost(cityId) as RedirectToRouteResult;

            // Assert
            Assert.AreEqual("Index", result.RouteValues["action"]);
        }
Exemple #2
0
        public void DeleteCitySuccess_When_input_data_is_correct()
        {
            // Arrange
            controller = new FavoriteCitiesController(mockUnitOfWork.Object);
            var cityId = 1;

            // Act
            var result = controller.DeletePost(cityId) as RedirectToRouteResult;

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