public BackgroundCheckerTests() { serviceCheckerMock = new Mock <IServiceChecker>(); serviceStoreMock = new Mock <IServiceStore>(); serviceStoreMock.Setup(ss => ss.GetAll()) .Returns(new List <Shared.Service>() { TestService }); backgroundCheckerConfigurationMock = new Mock <IOptions <BackgroundCheckerConfiguration> >(); backgroundCheckerConfigurationMock.SetupGet(bcc => bcc.Value) .Returns(TestBackgroundCheckerConfiguration); notificationServiceMock = new Mock <INotificationService>(); logger = new Mock <ILogger <BackgroundChecker> >(); backgroundChecker = new BackgroundChecker(serviceCheckerMock.Object, serviceStoreMock.Object, backgroundCheckerConfigurationMock.Object, notificationServiceMock.Object, logger.Object); }
public BackgroundCheckerTests() { ResultWithErrors = new ServiceCheckResultDto { Errors = new Dictionary <string, string> { { TestService.LocalNetworkUrl, "timeout" }, { TestService.PublicNetworkUrl, "404" } }, Service = TestService }; ResultWithoutErrors = new ServiceCheckResultDto { Errors = new Dictionary <string, string>(), Service = TestService }; serviceCheckerMock = new Mock <IServiceChecker>(); serviceStoreMock = new Mock <IServiceStore>(); serviceStoreMock.Setup(ss => ss.GetAll()) .Returns(new List <Shared.Service>() { TestService }); backgroundCheckerConfigurationMock = new Mock <IOptions <BackgroundCheckerConfiguration> >(); backgroundCheckerConfigurationMock.SetupGet(bcc => bcc.Value) .Returns(TestBackgroundCheckerConfiguration); notificationServiceMock = new Mock <INotificationService>(); logger = new Mock <ILogger <BackgroundChecker> >(); backgroundChecker = new BackgroundChecker(serviceCheckerMock.Object, serviceStoreMock.Object, backgroundCheckerConfigurationMock.Object, notificationServiceMock.Object, logger.Object); }