Skip to content

Instantly share code, notes, and snippets.

@stoolrossa
Created July 26, 2013 09:55
Show Gist options
  • Save stoolrossa/6087703 to your computer and use it in GitHub Desktop.
Save stoolrossa/6087703 to your computer and use it in GitHub Desktop.
public class DrinkOrderContext : SpecificationContext
{
protected Mock<IPriceList> drinksMenu;
protected Mock<IClock> clock;
protected List<Order> orders;
protected decimal halfPrice = 17.05m;
protected decimal fullPrice = 34.10m;
public override void Given()
{
base.Given();
// create mock price list
this.drinksMenu = new Mock<IPriceList>();
// setup lookup method for three drinks
drinksMenu.Setup(dm => dm.LookupPrice("Little Creatures Pale Ale")).Returns(7);
drinksMenu.Setup(dm => dm.LookupPrice("Pigs Fly Pale Ale")).Returns(8);
drinksMenu.Setup(dm => dm.LookupPrice("Hitachino White Ale")).Returns(9);
// create mock clock
this.clock = new Mock<IClock>();
// create the list of orders
this.orders = new List<Order>();
orders.Add(new Order() { Drink = "Little Creatures Pale Ale", Quantity = 2 });
orders.Add(new Order() { Drink = "Pigs Fly Pale Ale", Quantity = 1 });
orders.Add(new Order() { Drink = "Hitachino White Ale", Quantity = 1 });
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment