Exemplo n.º 1
0
        public void GetOpportunityByName_Ok()
        {
            var jsonOpportunity = @"
                    {
                        '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': false,
                        'CareerId': '1',
                        'ServiceId': '1',
                        'ProfessionalLevelId': '1',
                        'OpportunityTypeId': '1',
                    }";

            var opportunity = JsonConvert.DeserializeObject <Opportunity>(jsonOpportunity);

            var opportunityName = "Squad Care";

            _opportunityRepositoryMock.Setup(x => x.GetOpportunityByName(opportunityName)).Returns(opportunity);

            var service = new OpportunityService(_opportunityRepositoryMock.Object);

            var result = service.GetOpportunityByName(opportunityName);

            Assert.IsNotNull(result);
        }