public void GetEngineNotFound() { // Set up Prerequisites var controller = new EnginesController(); // Act var actionResult = controller.GetEngine(4); // Assert Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult)); }
public void GetAll() { // Set up Prerequisites var controller = new EnginesController(); // Act on Test var response = controller.GetEngine(); var contentResult = response as OkNegotiatedContentResult <IQueryable <Engine> >; // Assert the result Assert.AreEqual(3, response.Count()); }
public void GetByEngineId() { // Set up Prerequisites var controller = new EnginesController(); // Act on Test var response = controller.GetEngine(1); var contentResult = response as OkNegotiatedContentResult <Engine>; // Assert the result Assert.IsNotNull(contentResult); Assert.IsNotNull(contentResult.Content); Assert.AreEqual(1, contentResult.Content.id); Assert.AreEqual("Petrol", contentResult.Content.typeEngine); }