public void UpdateOpportunity_BadRequest() { var jsonDataTable = @""; var opportunity = JsonConvert.DeserializeObject <Opportunity>(jsonDataTable); var control = new OpportunityController(_opportunityService.Object); var result = control.UpdateOpportunity(opportunity); var badRequestResult = result as BadRequestResult; Assert.AreEqual(400, badRequestResult.StatusCode); }
public void UpdateOpportunity_ok() { var jsonDataTable = @"{ 'opportunityId': 1, 'opportunityName': 'Squad Care alterado', 'opportunityRequirements': '.NET Core', 'desirableRequirements': 'Conhecimento em Kafka', 'dateRegister':'2021-05-05', 'closingDate':'2021-05-05', 'cancellationDate':'2021-05-05', 'opportunityStatus': true }"; var opportunity = JsonConvert.DeserializeObject <Opportunity>(jsonDataTable); var control = new OpportunityController(_opportunityService.Object); var result = control.UpdateOpportunity(opportunity); var okResult = result as OkResult; Assert.AreEqual(200, okResult.StatusCode); }