private static ProjectController GetApiProjectController(Mock<ProjectService> serviceMock) { var controller = new ProjectController(serviceMock.Object); ContextUtil.SetApiControllerContext( controller, request: new HttpRequestMessage(HttpMethod.Post, "http://localhost/api/projects"), routeData: new HttpRouteData( new HttpRoute(), new HttpRouteValueDictionary { { "controller", "projects" }, { "action", "Post" } })); return controller; }
public void ConstructorTest() { var controller = new ProjectController(new Mock<ProjectService>().Object); controller.Should().NotBeNull(); }