public void GetAllOpportunities_Ok() { var jsonDataTable = @"[ { 'OpportunityId': '1', 'OpportunityName': 'Squad Care', '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': true, 'CareerId': '1', 'ServiceId': '1', 'ProfessionalLevelId': '1', 'OpportunityTypeId': '1', } ]"; var listOpportunities = JsonConvert.DeserializeObject <List <Opportunity> >(jsonDataTable); _opportunityService.Setup(x => x.GetAllOpportunities()).Returns(listOpportunities); var control = new OpportunityController(_opportunityService.Object); var result = control.GetAllOpportunities(); var okResult = result as OkObjectResult; Assert.IsNotNull(result); Assert.AreEqual(200, okResult.StatusCode); }