public HtmlStrategyTests()
 {
     _coreDependencies        = CoreDependencies.Setup();
     _emailHtmlContent        = _testHelper.GetFileDataEmbeddedInAssembly("WeeklyEmailHtmlContent.html");
     _simpleHtmlEmailContent  = _testHelper.GetFileDataEmbeddedInAssembly("SImpleEmailInHtml.html");
     _complexHtmlEmailContent = _testHelper.GetFileDataEmbeddedInAssembly("ComplexEmail.html");
 }
        public static async Task Listener([QueueTrigger(DataStores.Queues.QueueNameTriggerEmail)] string queueItem, ILogger log)
        {
            log.LogInformation("Starting MailSchedulerStatusListener function");
            var coreDependencies = CoreDependencies.Setup(log);

            coreDependencies.DiagnosticLogging.Verbose("MailSchedulerStatusListener received message at: {Now} UTC", DateTime.UtcNow);

            var repo = new DataSchedulerRepository(coreDependencies);
            await repo.ClearMailOperationProgressAsync();
        }
        public static async Task Run([TimerTrigger("0/15 * * * * *")] TimerInfo myTimer, ILogger log)
        {
            var coreDependencies = CoreDependencies.Setup(log);

            var now = DateTime.UtcNow;

            coreDependencies.DiagnosticLogging.Verbose("MailScheduler: Timer trigger function executed at: {now} UTC", now);

            // Setup dependencies and invoke main processing component.
            var engine = new SchedulingEngine(coreDependencies, new DataSchedulerRepository(coreDependencies));
            await engine.ScheduleMailCollectionIfNotInProgressAsync();
        }
        public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequestMessage req, ILogger log)
        {
            var coreDependencies = CoreDependencies.Setup(log);

            coreDependencies.DiagnosticLogging.Verbose("QueryMail: HTTP trigger function executed at: {Now} UTC", DateTime.UtcNow);

            // Setup dependencies and invoke main processing component.
            var engine      = new QueryEngine(coreDependencies, new QueryApiRepository(coreDependencies));
            var apiResponse = await engine.GetMailSentimentListAsync();

            return(apiResponse.ToHttpResponseMessage(req));
        }
        public async static Task Run([QueueTrigger(DataStores.Queues.QueueNameCleanEmail)] string myQueueItem, ILogger log)
        {
            var dependencies    = CoreDependencies.Setup(log);
            var receivedMessage = GenericActionMessage.FromString(myQueueItem);

            var now = DateTime.UtcNow;

            dependencies.DiagnosticLogging.Verbose("Sanitisation: MailSanitiser Timer trigger function executed at: {now} UTC", now);

            var repo   = new MailSanitiserRepository(dependencies);
            var engine = new MailSanitiserEngine(dependencies, repo);
            await engine.SanitiseMailAsync(receivedMessage);
        }
        public static async Task Run([QueueTrigger(DataStores.Queues.QueueNameCollectEmail)] string myQueueItem, ILogger log)
        {
            var dependencies = CoreDependencies.Setup(log);

            var now = DateTime.UtcNow;

            dependencies.DiagnosticLogging.Verbose("MailCollection: MailCollector Queue trigger function executed at: {now} UTC", now);

            var mailConfig = EmailConfiguration.PopulateConfigFromEnviromentVariables(dependencies);
            var engine     = new CollectionEngine(dependencies, new MailCollectionRepository(dependencies), mailConfig);

            var queueMsg = GenericActionMessage.FromString(myQueueItem);
            await engine.PerformMailCollectionAsync(queueMsg);
        }
Example #7
0
        public async static Task Run([QueueTrigger(DataStores.Queues.QueueNameProcessEmail)] string myQueueItem, ILogger log)
        //public async static Task Run([HttpTrigger("GET")]string myQueueItem, ILogger log)
        {
            var dependencies    = CoreDependencies.Setup(log);
            var receivedMessage = GenericActionMessage.FromString(myQueueItem);
            var analysisConfig  = AnalysisConfiguration.PopulateConfigFromEnviromentVariables(dependencies);

            var now = DateTime.UtcNow;

            dependencies.DiagnosticLogging.Verbose("MailProcessor: Timer trigger function executed at: {now} UTC", now);

            var repo   = new MailProcessorRepository(dependencies);
            var engine = new MailProcessingEngine(dependencies, repo, analysisConfig);
            await engine.AnalyseAllMailAsync(receivedMessage);
        }
 public MailCollectionTests()
 {
     _coreDependencies = CoreDependencies.Setup();
 }
Example #9
0
 public MailSanitisationTests()
 {
     _coreDependencies = CoreDependencies.Setup();
 }
Example #10
0
 public QueryApiTests()
 {
     _coreDependencies = CoreDependencies.Setup();
 }
 public ConfigTests()
 {
     _coreDependencies = CoreDependencies.Setup();
 }
Example #12
0
 public CoreExtensionsTests()
 {
     _coreDependencies = CoreDependencies.Setup();
 }
 static ConfigExtensions()
 {
     _dependencyInstances = CoreDependencies.Setup();
 }
 public MailProcessorTests()
 {
     _coreDependencies = CoreDependencies.Setup();
 }
Example #15
0
 public MessageTests()
 {
     _coreDependencies = CoreDependencies.Setup();
 }