public void GivenBricksburgLocation_WhenAskingForMiniSizePizza_ThenItShouldReturnCorrectValue() { // arrange Order order = new Order { Location = "Bricksburg", Products = new[] { new ProductRequest { Name = "Pizza", Size = "Personal", Ingredients = new [] { "Mushrooms" } } } }; // act Invoice invoice = order.Invoice(); // assert Privateer privateer = new Privateer(); List <LineItem> lineItems = privateer.Field <List <LineItem> >(invoice, "_lineItems"); lineItems.Should().HaveCount(1); privateer.Field <string>(lineItems[0], "_description").Should().Be("Personal Pizza with Mushrooms"); privateer.Field <string>(lineItems[0], "_price").Should().Be("17,33 &"); }
public void GivenSpringfieldLocation_WhenAskingForMiniSizePizzaWithCrispyHam_ThenItShouldReturnCorrectValue() { // arrange Order order = new Order { Location = "Springfield", Products = new[] { new ProductRequest { Name = "Pizza", Size = "Mini", Ingredients = new [] { "Crispy Ham" } } } }; // act Invoice invoice = order.Invoice(); // assert Privateer privateer = new Privateer(); List <LineItem> lineItems = privateer.Field <List <LineItem> >(invoice, "_lineItems"); lineItems.Should().HaveCount(1); privateer.Field <string>(lineItems[0], "_description").Should().Be("Mini Pizza with Crispy Ham"); privateer.Field <string>(lineItems[0], "_price").Should().Be("$10.35"); }
public void GivenPersonalSizePizza_WhenAskingForInvoice_ThenItShouldReturnCorrectInvoice() { // arrange Order order = new Order { Location = "Bedrock", Products = new [] { new ProductRequest { Name = "Pizza", Size = "Personal", Ingredients = new [] { "Mushrooms", "Pepperoni" } } } }; // act Invoice invoice = order.Invoice(); // assert Privateer privateer = new Privateer(); List <LineItem> lineItems = privateer.Field <List <LineItem> >(invoice, "_lineItems"); lineItems.Should().HaveCount(1); privateer.Field <string>(lineItems[0], "_description").Should().Be("Personal Pizza with Mushrooms and Pepperoni"); privateer.Field <string>(lineItems[0], "_price").Should().Be("$11.25"); }
public void GivenBricksburgLocationPersonalSizePizzaAndChangedIngredients_WhenAskingForInvoice_ThenItShouldReturnCorrectInvoice() { // arrange Order order = new Order { Location = "Bricksburg", Products = new [] { new ProductRequest { Name = "Pizza", Size = "Personal", Ingredients = new [] { "Mushrooms", "Pepperoni" } } } }; order.Products = new[] { new ProductRequest { Name = "Pizza", Size = "Personal", Ingredients = new[] { "Pepperoni" } } }; // act Invoice invoice = order.Invoice(); // assert Privateer privateer = new Privateer(); List <LineItem> lineItems = privateer.Field <List <LineItem> >(invoice, "_lineItems"); lineItems.Should().HaveCount(1); privateer.Field <string>(lineItems[0], "_description").Should().Be("Personal Pizza with Pepperoni"); privateer.Field <string>(lineItems[0], "_price").Should().Be("18,11 &"); string serializedInvoice = JsonConvert.SerializeObject(invoice); }
public void GivenHalfSizeCalzoneWithChangedSizeAndIngredients_WhenAskingForInvoice_ThenItShouldReturnCorrectInvoice() { // arrange Order order = new Order { Location = "Bedrock", Products = new[] { new ProductRequest { Name = "Calzone", Size = "Half-Size", Ingredients = new [] { "Mushrooms", "Pepperoni" } } } }; order.Products = new[] { new ProductRequest { Name = "Calzone", Size = "Full", Ingredients = new[] { "Pepperoni" } } }; // act Invoice invoice = order.Invoice(); // assert Privateer privateer = new Privateer(); List <LineItem> lineItems = privateer.Field <List <LineItem> >(invoice, "_lineItems"); lineItems.Should().HaveCount(1); privateer.Field <string>(lineItems[0], "_description").Should().Be("Full Calzone with Pepperoni"); privateer.Field <string>(lineItems[0], "_price").Should().Be("$16.10"); }