Making the untestable testable with Anonymous Methods and Dependency Injection

Posted by: Karl Seguin [MVP], on 08 May 2009 | View original | Bookmarked: 0 time(s)

Making the untestable testable with Anonymous Methods and Dependency Injection It can be frustrating to want to write unit tests, only to hit some code which is rather untestable. Take for example, the following code: public class MailSender { public void SendActivationMail(User user, string activationCode) { string body = GetCopyOfActivationBody(); //implementation doesn't matter body = body.Replace("#NAME#", user.Name).Replace("#CODE#", activationKey).Replace("#EMAIL#",...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: Architecture | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 873 | Hits: 39

Similar Posts

  • Technology Related Links for May 8th, 2009 more
  • Framework Design Guidelines: Dependency Properties more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD