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