public void FacadeInsertAMonumentAndRemoveContentCheck() { //Arrange MockRepository mockRepository = new MockRepository(); MonumentController monumentController = new MonumentController(mockRepository); Monument dummyMonument = new Monument() { Id = 1, MonumentNaam = "Manneke pis" }; //Act monumentController.Post(dummyMonument); monumentController.Delete((int)dummyMonument.Id); List <Monument> result = (List <Monument>)monumentController.Get(); //Assert Assert.AreEqual(1, mockRepository.NumberOfTimesAddCalled); Assert.AreEqual(1, mockRepository.NumberOfTimesRemoveCalled); CollectionAssert.DoesNotContain(result, dummyMonument); }
public void FacadeInsertAMonumentAndRemoveCallCount() { //Arrange MockRepository mockRepository = new MockRepository(); MonumentController monumentController = new MonumentController(mockRepository); Monument dummyMonument = new Monument() { Id = 1, MonumentNaam = "Manneke pis" }; //Act monumentController.Post(dummyMonument); monumentController.Delete((int)dummyMonument.Id); //Assert Assert.AreEqual(1, mockRepository.NumberOfTimesAddCalled); Assert.AreEqual(1, mockRepository.NumberOfTimesRemoveCalled); }