Created
March 29, 2017 07:33
-
-
Save eamonnmcevoy/4d2b463246393109704b078622e2aeb3 to your computer and use it in GitHub Desktop.
Example of un-testable class
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
using System.Text; | |
using System; | |
namespace BigLegacyApplication | |
{ | |
internal class ReportGenerator | |
{ | |
public ReportGenerator() | |
{ | |
} | |
internal string GetUserReport(int userId) | |
{ | |
var userService = new UserService(); | |
var user = userService.GetUser(userId); | |
var resultsService = new ResultsService(); | |
var results = resultsService.GetUserResults(userId); | |
var sb = new StringBuilder(); | |
sb.AppendLine(string.Format("{0} {1}", user.Firstname, user.Surname)); | |
sb.AppendLine(string.Join(",", results)); | |
sb.AppendLine(string.Format("Date: {0}", DateTime.Now.ToString())); | |
return sb.ToString(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment