public void DeleteDelivery() { var deliveryService = new Mock <IDeliveryBusinessLayer>(); deliveryService.Setup(x => x.GetDeliveryByID(1)) .Returns(testdelivery); var controller = new DeliveryController(deliveryService.Object); IHttpActionResult actionResult = controller.DeleteDelivery(1); Assert.IsInstanceOfType(actionResult, typeof(OkNegotiatedContentResult <Delivery>)); }