public void CreateZoneTest() { ZoneDTO zone = new ZoneDTO(); zone.MaxCapacity = 60; zone.Name = "Zona 1"; UserDTO user = createUserDTO(); Guid token = Guid.NewGuid(); var mockUserService = new Mock <UserService>(); mockUserService.Setup(us => us.GetUserLoggedIn(token)).Returns(user); var mockZoneService = new Mock <ZoneService>(); mockZoneService.Setup(zs => zs.AddZone(zone)).Verifiable(); ZoneController zoneController = new ZoneController(mockUserService.Object, mockZoneService.Object, null); zoneController.Request = createUserControllerRequest(); addTokenHeaderToRequest(zoneController.Request, token); ResponseMessageResult response = (ResponseMessageResult)zoneController.Create(zone); Assert.AreEqual(HttpStatusCode.Created, response.Response.StatusCode); }