public void GetDeliveriesList_ReturnsCorrectViewResult() { // Arrange Mock <IDeliveryProvider> deliveryProviderMock = new Mock <IDeliveryProvider>(); deliveryProviderMock.Setup(x => x.GetAll()) .Returns(deliveries); Mock <IDeliveryHandler> deliveryHandlerMock = new Mock <IDeliveryHandler>(); Mock <IDeliveryValidator> deliveryValidatorMock = new Mock <IDeliveryValidator>(); DeliveryController controller = new DeliveryController(deliveryProviderMock.Object, deliveryHandlerMock.Object, deliveryValidatorMock.Object); // Act ViewResult result = controller.GetDeliveriesList() as ViewResult; // Assert Assert.IsNotNull(result); Assert.IsTrue(((List <Delivery>)result.Model).Count == 2); Assert.AreEqual("GetDeliveriesList", result.ViewName); }