Example #1
0
        public void JobProfileServiceSegmentsHealthCheckReturnsSuccess()
        {
            // arrange
            var repository     = A.Fake <ICosmosRepository <JobProfileModel> >();
            var segmentService = A.Fake <ISegmentService>();
            var mapper         = A.Fake <IMapper>();
            IList <HealthCheckItem> expectedResult = new List <HealthCheckItem>
            {
                new HealthCheckItem
                {
                    Service = "Unit test",
                    Message = "All ok",
                },
            };

            A.CallTo(() => segmentService.SegmentsHealthCheckAsync()).Returns(expectedResult);

            var jobProfileService = new JobProfileService(repository, segmentService, mapper);

            // act
            var result = jobProfileService.SegmentsHealthCheckAsync().Result;

            // assert
            A.CallTo(() => segmentService.SegmentsHealthCheckAsync()).MustHaveHappenedOnceExactly();
            A.Equals(result, expectedResult);
        }
Example #2
0
        public void JobProfileServicePingReturnsFalseWhenMissingRepository()
        {
            // arrange
            var repository     = A.Dummy <ICosmosRepository <JobProfileModel> >();
            var expectedResult = false;

            A.CallTo(() => repository.PingAsync()).Returns(expectedResult);

            var jobProfileService = new JobProfileService(repository, A.Fake <SegmentService>(), mapper);

            // act
            var result = jobProfileService.PingAsync().Result;

            // assert
            A.CallTo(() => repository.PingAsync()).MustHaveHappenedOnceExactly();
            A.Equals(result, expectedResult);
        }
Example #3
0
 public JobProfileServiceTests()
 {
     jobProfileService = new JobProfileService(fakeLogger, fakeJobProfileApiConnector, fakeJobProfilesToSocMappingService);
 }
Example #4
0
 public JobProfileServiceTests()
 {
     jobProfileService = new JobProfileService(fakeLogger, fakeJobProfileApiConnector, fakeJobProfilesToSocMappingService, socJobProfilesMappingsCachedModel);
 }