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