public void We_can_read_email_addresses_as_lines_from_stream() { var contents = @"[email protected] [email protected]"; using (MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(contents))) { MailingLogic.LineBasedEmailAddresses(ms).ShouldBeEquivalentTo(new string[] { "*****@*****.**", "*****@*****.**" }); } }
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); } }