Skip to content

Instantly share code, notes, and snippets.

@darrencauthon
Created January 23, 2012 12:02
Show Gist options
  • Save darrencauthon/1662749 to your computer and use it in GitHub Desktop.
Save darrencauthon/1662749 to your computer and use it in GitHub Desktop.
My comment on Ayende's queries v. abstractions
public void Index_should_return_the_best_selling_products(){
var products = new [new Product()];
var fakeService = new Mock<IHomeControllerWorkerServices>()
.Setup(x=>x.GetBestSellingProductCategories())
.Returns(products);
// regular work...
results.ShouldBeSameAs(products);
}
public void Index_should_return_the_best_selling_products(){
var products = // A BUNCH OF DATABASE SETUP TO REPLICATE THE SITUATION
// regular work...
results.ShouldContain(expectedProductA????);
results.ShouldContain(expectedProductB????);
// have fun writing this assert...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment