예제 #1
0
        public void Delete_ShouldReturnOk()
        {
            //arrange
            Place place = TestDataHelper.GeneratePlace();
            var placeController = new PlaceController(TestDataHelper.GetIPlaceRepositoryMock(place));

            //act
            placeController.Create(place);
            IHttpActionResult response = placeController.Delete(place.Id);

            //assert
            Assert.IsTrue(response is OkResult);
        }
예제 #2
0
        public void Delete_NonExistPlace_ShouldReturnNotFound()
        {
            //arrange
            Place place = TestDataHelper.GeneratePlace();
            var placeController = new PlaceController(TestDataHelper.GetIPlaceRepositoryMock(null));

            //act
            IHttpActionResult response = placeController.Delete(place.Id);

            //assert
            Console.WriteLine(response);
            Assert.IsTrue(response is NotFoundResult);
        }