-
-
Save profesor79/79b7a522e43296f3b5e0eef9ede69950 to your computer and use it in GitHub Desktop.
bigStorySmallResults
This file contains hidden or 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
public class Email | |
{ | |
static string TemplateStart = "Hi,<br/><br/> Click on below given link to Reset Your Password<br/> <a href="; | |
static string TemplateEnd = ">Click here to change your password</a><br/>"; | |
static string Template = "Hi,<br/><br/> Click on below given link to Reset Your Password<br/> <a href= __callbackUrl__>Click here to change your password</a><br/>"; | |
static string TextToBeReplaced = "__callbackUrl__"; | |
public void Was() | |
{ | |
SendEmail("user.UserName", "Reset Password", "Please reset your password by clicking <a href=\"" + "callbackUrl" + "\">here</a>."); | |
} | |
public void Edited() | |
{ | |
StringBuilder sb = new StringBuilder(); | |
sb.Append(""); | |
sb.Append(""); | |
sb.Append("<br/><b>Thanks</b>"); | |
SendEmail("user.UserName", "Reset Password", Convert.ToString(sb)); | |
} | |
public void RefactoredWithReplace() | |
{ | |
SendEmail("user.UserName", "Reset Password", Template.Replace(TextToBeReplaced, "replacement")); | |
} | |
public void RefactoredWithReplaceRegex() | |
{ | |
SendEmail("user.UserName", "Reset Password", Regex.Replace(Template, TextToBeReplaced, "replacement")); | |
} | |
public void RefactoredAddTemplates() | |
{ | |
SendEmail("user.UserName", "Reset Password", TemplateStart + "allbacurl" + TemplateEnd); | |
} | |
public void RefactoredConcateTemplates() | |
{ | |
SendEmail("user.UserName", "Reset Password", string.Concat(TemplateStart, "allbacurl", TemplateEnd)); | |
} | |
private void SendEmail(string v1, string v2, string v3) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment