private static SelfCheckout EnterItem(SelfCheckout selfCheckout, int index) { var price = Input.Parse(message: string.Format("Price of item {0}: ", index)); var quantity = Input.Parse(message: string.Format("Quantity of item {0}: ", index)); return selfCheckout.Scan(price, quantity); }
private static SelfCheckout EnterItem(SelfCheckout selfCheckout, int index) { var price = Input.Parse(message: string.Format("Price of item {0}: ", index)); var quantity = Input.Parse(message: string.Format("Quantity of item {0}: ", index)); return(selfCheckout.Scan(price, quantity)); }
public void SubTotal_Of_One_Item_Scanned() { var subject = new SelfCheckout(); decimal total = subject .Scan(price: 25, quantity: 1) .SubTotal(); Assert.That(total, Is.EqualTo(25.00m)); }
public void Tax_Of_One_Item_Scanned() { var subject = new SelfCheckout(); decimal tax = subject .Scan(price: 25, quantity: 1) .Tax(); Assert.That(tax, Is.EqualTo(1.375m)); }
public void Total_Of_One_Item_Scanned() { var subject = new SelfCheckout(); decimal total = subject .Scan(price: 25, quantity: 1) .Total(); Assert.That(total, Is.EqualTo(26.375m)); }
public void Tax_Of_One_Item_Scanned_With_Multiple_Quantities() { var subject = new SelfCheckout(); decimal total = subject .Scan(price: 25, quantity: 2) .Tax(); Assert.That(total, Is.EqualTo(2.75m)); }
public void SubTotal_Of_Multiple_Items_Scanned_With_Multiple_Quantities() { var subject = new SelfCheckout(); decimal total = subject .Scan(price: 25, quantity: 2) .Scan(price: 10, quantity: 1) .SubTotal(); Assert.That(total, Is.EqualTo(60m)); }
public void Scanning_Multiple_Items() { var subject = new SelfCheckout(); subject = subject .Scan(price: 25, quantity: 2) .Scan(price: 10, quantity: 1) .Scan(price: 4, quantity: 1); Assert.That(subject.SubTotal(), Is.EqualTo(64.00m)); Assert.That(subject.Tax(), Is.EqualTo(3.52m)); Assert.That(subject.Total(), Is.EqualTo(67.52m)); }
public void Tax_Of_One_Item_Scanned() { var subject = new SelfCheckout(); decimal tax = subject .Scan(price: 25, quantity: 1) .Tax(); Assert.That(tax, Is.EqualTo(1.375m)); }
public void Scanning_Multiple_Items() { var subject = new SelfCheckout(); subject = subject .Scan(price: 25, quantity: 2) .Scan(price: 10, quantity: 1) .Scan(price: 4, quantity: 1); Assert.That(subject.SubTotal(), Is.EqualTo(64.00m)); Assert.That(subject.Tax(), Is.EqualTo(3.52m)); Assert.That(subject.Total(), Is.EqualTo(67.52m)); }
public void SubTotal_Of_Multiple_Items_Scanned_With_Multiple_Quantities() { var subject = new SelfCheckout(); decimal total = subject .Scan(price: 25, quantity: 2) .Scan(price: 10, quantity: 1) .SubTotal(); Assert.That(total, Is.EqualTo(60m)); }
public void Tax_Of_One_Item_Scanned_With_Multiple_Quantities() { var subject = new SelfCheckout(); decimal total = subject .Scan(price: 25, quantity: 2) .Tax(); Assert.That(total, Is.EqualTo(2.75m)); }