Created
January 23, 2012 12:02
-
-
Save darrencauthon/1662749 to your computer and use it in GitHub Desktop.
My comment on Ayende's queries v. abstractions
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 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); | |
} | |
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 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