public void GetReserveIdShouldNot() { // Arrange int id = 1000; ReservesController controller = new ReservesController(); // Act IHttpActionResult actionResult = controller.GetReserve(id); var contentResult = actionResult as NotFoundResult; // Assert Assert.IsType <NotFoundResult>(actionResult); }
public void GetReserveShould() { // Arrange DBEntities db = new DBEntities(); ReservesController controller = new ReservesController(); // Act IQueryable <Reserve> expected = db.Reserve; IQueryable <Reserve> actual = controller.GetReserve(); // Assert Assert.True(actual != null); Assert.Equal(expected.Count(), actual.Count()); }