public void TestDeleteBuilding() { Building a = new Building() { BuildingId = "1", Name = "Building1", Address = "Address", Admin = "1" }; var mockBuildingValidator = new Mock <IBuildingValidator>(); mockBuildingValidator.Setup(x => x.DeleteBuilding("1")).Verifiable(); mockBuildingValidator.Setup(x => x.secure(null)).Verifiable(); mockBuildingValidator.Setup(x => x.AtmSecure(null)).Verifiable(); var controller = new BuildingsController(mockBuildingValidator.Object); var controllerContext = new HttpControllerContext(); var request = new HttpRequestMessage(); request.Headers.Add("TODO_PAGOS_TOKEN", "1"); controllerContext.Request = request; controller.ControllerContext = controllerContext; IHttpActionResult actionResult = controller.DeleteBuilding("1"); var contentResult = actionResult as OkNegotiatedContentResult <IEnumerable <Building> >; Assert.IsNotNull(actionResult); }