public void Delete() { // Arrange DeviseController controller = new DeviseController(); // Act IHttpActionResult result1 = controller.Delete(2); IHttpActionResult result2 = controller.Delete(15); // Assert Assert.IsInstanceOfType(result2, typeof(NotFoundResult)); Assert.IsNotNull(result1); Assert.IsInstanceOfType(result1, typeof(OkNegotiatedContentResult <Devise>)); var result = controller.Delete(1) as OkNegotiatedContentResult <Devise>; Assert.AreEqual(new Devise(1, "Dollar", 1.08), result.Content); }
public void DeleteTest() { DeviseController dc = new DeviseController(); OkNegotiatedContentResult <Devise> toDelete = (OkNegotiatedContentResult <Devise>)dc.Get(2); OkNegotiatedContentResult <Devise> result = (OkNegotiatedContentResult <Devise>)dc.Delete(2); Assert.AreEqual(result.Content, toDelete.Content); }