public void InsertOpportunity_Ok() { var jsonDataTable = @"{ 'opportunityId': 1, 'opportunityName': 'Squad Care alterado', 'opportunityRequirements': '.NET Core', 'desirableRequirements': 'Conhecimento em Kafka', 'dateRegister': '2021-05-05T00:00:00', 'closingDate': '2021-05-05T00:00:00', 'cancellationDate': '2021-05-05T00:00:00', 'opportunityStatus': false, 'career': { 'careerId': 1 }, 'service': { 'serviceId': 1 }, 'professionalLevel': { 'professionalLevelId': 1 }, 'opportunityType': { 'opportunityTypeId': 1 } }"; var opportunity = JsonConvert.DeserializeObject <Opportunity>(jsonDataTable); var control = new OpportunityController(_opportunityService.Object); var result = control.InsertOpportunity(opportunity); var okResult = result as OkResult; Assert.AreEqual(200, okResult.StatusCode); }
public void InsertOpportunity_BadRequest() { var jsonDataTable = @""; var opportunity = JsonConvert.DeserializeObject <Opportunity>(jsonDataTable); var control = new OpportunityController(_opportunityService.Object); var result = control.InsertOpportunity(opportunity); var badRequestResult = result as BadRequestResult; Assert.AreEqual(400, badRequestResult.StatusCode); }