public void TestOrderController_SendEmailOrderSubmit_ShouldReturnNullIfSendEmailSuccessed(string httpMethod) { var httpContextMock = FakeHttpContext(httpMethod); var controllerMock = new Mock <ControllerBase>(MockBehavior.Loose); var routeData = new RouteData(); routeData.Values.Add("controller", "/ProjectDashboard/Orders"); var controllerContext = new ControllerContext(httpContextMock, routeData, controllerMock.Object); orderController.ControllerContext = controllerContext; var result = orderController.SendEmailOrderSubmit(orderVMLight) as ViewResult; Assert.That(result.ViewName, Is.EqualTo("ConfirmEstDeliveryDate")); }