public void When_UsingBlogDelegate_Should_PostToBlog() { Document doc = new Document(); doc.Text = "This is the Document's text"; var blogPoster = new BlogPoster(); var blogDelegate = new Document.SendDocument(blogPoster.PostBlog); Assert.AreEqual("Sending post", doc.SendAndReport(blogDelegate)); }
public void When_UsingEmailDelegate_Should_SendToEmail() { Document doc = new Document(); doc.Text = "This is the Document's text"; var emailServer = new EmailServer(); var emailDelegate = new Document.SendDocument(emailServer.SendEmail); Assert.AreEqual("Sending email", doc.SendAndReport(emailDelegate)); }