Exemplo n.º 1
0
        private CancelOnBulking GetNewCancelOnBulking(OenContext oenContext, CancelOnBulkingSettings settings)
        {
            var logger = new Logger("COB");
            var jobRepository = new JobRepository(oenContext, logger, settings.DatabaseTestMode);
#if DEBUG
            var mta = new PmtaMonitoring.Testing.Mocking.MtaAgentMock(0, logger);
#else
            var mta = new MtaAgent(logger, settings.MtaTestMode);
#endif

            return new CancelOnBulking(logger,
                                       mta,
                                       new EmailNotification(logger, jobRepository, settings.NotifyEmails, settings.SmtpServer),
                                       oenContext,
                                       new EventRepository(oenContext),
                                       jobRepository
                                       );
        }
Exemplo n.º 2
0
        private Four21 GetNewFour21(OenContext oenContext, Four21Settings settings)
        {
            var logger = new Logger("421");
#if DEBUG
            var mta = new PmtaMonitoring.Testing.Mocking.MtaAgentMock(0, logger);
#else
            var mta = new MtaAgent(logger, settings.MtaTestMode);
#endif

            return new Four21(logger,
                              mta,
                              new EmailNotification(logger, new JobRepository(oenContext, logger, settings.DatabaseTestMode),
                              settings.NotifyEmails,
                              settings.SmtpServer),
                              () => new OenContext(),
                              u => new EventRepository((OenContext) u),
                              u => new PmtaRepository((OenContext) u),
                              u => new DeliveryGroupRepository((OenContext) u),
                              u => new JobRepository((OenContext) u, logger, settings.DatabaseTestMode)
                              );
        }