public void DeleteProduct_ShouldNotFound() { var context = new TestMachineContextGood(); var item = GetDemoProduct(); context.Machines.Add(item); var controller = new MachinesController(context); var result = controller.DeleteMachine(555).Result; Assert.IsNotNull(result); Assert.AreEqual(result.GetType(), typeof(NotFoundResult)); }
public void DeleteProduct_ShouldReturnOK() { var context = new TestMachineContextGood(); var item = GetDemoProduct(); context.Machines.Add(item); var controller = new MachinesController(context); var result = controller.DeleteMachine(1).Result as OkNegotiatedContentResult <Machine>; Assert.IsNotNull(result); Assert.AreEqual(item.Id, result.Content.Id); }