Forked from ferclaverino/ContactInformationAuctionMessageBuilder.cs
Created
August 5, 2012 03:14
-
-
Save colltoaction/3261337 to your computer and use it in GitHub Desktop.
Liskov - step 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ******* NO COMPILÉ ESTE ARCHIVO ********** | |
abstract class MailMessageBuilder | |
{ | |
private MailMessage mailMessage = new MailMessage(); | |
public MailMessageBuilder WithTo(string to) | |
{ | |
mailMessage.To.Add(to); | |
return this; | |
} | |
public MailMessageBuilder WithSubject(string subject) | |
{ | |
mailMessage.Subject = subject; | |
return this; | |
} | |
public MailMessageBuilder WithFrom(string from) | |
{ | |
mailMessage.From = new MailAddress(from); | |
return this; | |
} | |
public MailMessage BuildMessage() | |
{ | |
mailMessage.Body = body.ToString(); | |
return mailMessage; | |
} | |
private void AddBodyLine(String line, params object[] args) | |
{ | |
body.AppendLine(String.Format(line, args)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment