Ejemplo n.º 1
0
        public async Task MailSanitisationShouldOnlyProceedThroughFirstStepOfWorkflowWhenNoMailCollected()
        {
            var repo   = new DummySanitiserRepo(0);
            var engine = new MailSanitiserEngine(_coreDependencies, repo);
            var msg    = new GenericActionMessage();
            await engine.SanitiseMailAsync(msg);

            Assert.Equal(1, repo.MailCollectionCount);
            Assert.Equal(0, repo.StoreSanitisedMaiLCount);
            Assert.Equal(0, repo.ClearedMailCount);
            Assert.Equal(1, repo.LodgeMailAcknowledgementCount); // need to ensure the ack is still sent
        }
Ejemplo n.º 2
0
        public async Task MailSanitisationShouldProceedThroughEntireWorkflowWhenMessagesAreCollected()
        {
            var repo   = new DummySanitiserRepo(2);
            var engine = new MailSanitiserEngine(_coreDependencies, repo);
            var msg    = new GenericActionMessage();
            await engine.SanitiseMailAsync(msg);

            Assert.Equal(1, repo.MailCollectionCount);
            Assert.Equal(1, repo.StoreSanitisedMaiLCount);
            Assert.Equal(1, repo.ClearedMailCount);
            Assert.Equal(1, repo.LodgeMailAcknowledgementCount);
            Assert.Equal(msg, repo.ActionMessageRecentlyLodged);
        }