-
Notifications
You must be signed in to change notification settings - Fork 3
Testability
Oskar Gewalli edited this page Jun 27, 2015
·
2 revisions
Isop will interpret an ienumerable result as what the developer intends to display
public class CustomerController
{
public CustomerController(ICustomerService svc)
{ //...
}
public IEnumerable<string> Add(string name)
{
yield return "Starting to add customer "+name;
var c = store.CreateCustomerWithName(name);
yield return "Setting up default preferences";
svc.SetupDefaultPreferenses(c);
yield return "Generating random password";
svc.GenerateRandomPassword(c);
yield return "Saving user to database";
c.Commit();
}
}