示例#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);
        }
示例#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);
        }
示例#3
0
 public JobProfileServiceTests()
 {
     jobProfileService = new JobProfileService(fakeLogger, fakeJobProfileApiConnector, fakeJobProfilesToSocMappingService);
 }
示例#4
0
 public JobProfileServiceTests()
 {
     jobProfileService = new JobProfileService(fakeLogger, fakeJobProfileApiConnector, fakeJobProfilesToSocMappingService, socJobProfilesMappingsCachedModel);
 }