Exemplo n.º 1
0
        static (FakeEmailSender mail, LogMailingScmBackup sut) BuildFakeLogMailingScmBackup(bool innerReturnValue)
        {
            var subBackup = new FakeScmBackup();

            subBackup.ToReturn = innerReturnValue;

            var messages = new LogMessages();

            messages.AddMessage("1");
            messages.AddMessage("2");

            var mail = new FakeEmailSender();

            var sut = new LogMailingScmBackup(subBackup, messages, mail);

            return(mail, sut);
        }
Exemplo n.º 2
0
        public void RunSendsMail()
        {
            var subBackup = new FakeScmBackup();

            var messages = new LogMessages();

            messages.AddMessage("1");
            messages.AddMessage("2");

            var mail = new FakeEmailSender();

            var sut = new LogMailingScmBackup(subBackup, messages, mail);

            sut.Run();

            Assert.NotNull(mail.LastSubject);
            Assert.NotNull(mail.LastBody);
            Assert.Contains("1", mail.LastBody);
            Assert.Contains("2", mail.LastBody);
        }