public void OneTimeSetUp() { _log = new Mock <ILog>().Object; var hostingEnvMock = new Mock <IHostingEnvironment>(); hostingEnvMock.Setup(x => x.ContentRootPath).Returns("../../../../../src/MarginTrading.NotificationGenerator/"); var builder = new ContainerBuilder(); var fakeSettings = new NotificationGeneratorSettings { MonthlyTradingReportSettings = new NotificationsSettings { EmailNotificationEnabled = true, Filter = new TradingReportFilter { LegalEntityRegex = "^LYKKECY$" }, InvocationTime = new TimeSpan(0, 0, 0), } }; builder.RegisterModule(new JobModule(new StaticSettingsManager <NotificationGeneratorSettings>(fakeSettings), _log, hostingEnvMock.Object)); var externalMockModule = new ExternalServiceMockModule(_log); EmailSenderMock = externalMockModule.EmailSenderMock; builder.RegisterModule(externalMockModule); Container = builder.Build(); TradingReportService = Container.Resolve <ITradingReportService>(); }
public ExternalServicesModule(NotificationGeneratorSettings settings, ILog log, IHostingEnvironment environment) { _log = log; _environment = environment; _settings = settings; _services = new ServiceCollection(); }
public JobModule(IReloadingManager <NotificationGeneratorSettings> settings, ILog log, IHostingEnvironment environment) { _log = log; _environment = environment; _settings = settings.CurrentValue; _settingsReloadingManager = settings; _services = new ServiceCollection(); }