public void Target_not_called_for_invalid_addresses()
        {
            var emailAddresses = new string[] { "*****@*****.**", "rubbish" };
            int count          = 0;

            MailingLogic.Process(emailAddresses,
                                 (em) => { return(em != "rubbish"); },
                                 em => em,
                                 (em, cnt) => { count++; });

            count.Should().Be(1);
        }
        public void Target_called_for_valid_addresses()
        {
            var emailAddresses = new string[] { "*****@*****.**", "*****@*****.**" };
            int count          = 0;

            MailingLogic.Process(emailAddresses,
                                 (em) => true,
                                 em => em,
                                 (em, cnt) => { count++; });

            count.Should().Be(2);
        }
        public void Putting_it_together()
        {
            var contents =
                @"bla bla 

[email protected]
[email protected]


oops new lines there";

            using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(contents)))
            {
                MailingLogic.Process(MailingLogic.LineBasedEmailAddresses(ms),
                                     MailingLogic.IsValidEmailAddress,
                                     MailingLogic.GetContentFor,
                                     MailingLogic.SendItReally);
            }
        }