public void ShouldGetCorrectAmountDue() { Order order = new Order(); order.Add(new BriarheartBurger()); RegisterUtility registerUtility = new RegisterUtility(order); Assert.Equal("$7.08", registerUtility.AmountDue); }
public void ChangingCustomerTwosPropertyShouldInvokeChange() { RegisterUtility registerUtility = new RegisterUtility(new Order()); Assert.PropertyChanged(registerUtility, "AmountDue", () => { registerUtility.CustomerTwos = 1; }); Assert.PropertyChanged(registerUtility, "CustomerTwos", () => { registerUtility.CustomerTwos = 0; }); }
public void ShouldGetCorrectChangePennies() { Order order = new Order(); order.Add(new BriarheartBurger()); RegisterUtility registerUtility = new RegisterUtility(order); Assert.Equal(0, registerUtility.ChangePennies); registerUtility.CustomerPennies = 708; Assert.Equal("$0", registerUtility.ChangeOwed); Assert.Equal(0, registerUtility.ChangePennies); registerUtility.CustomerPennies = 709; Assert.Equal("$0.01", registerUtility.ChangeOwed); Assert.Equal(1, registerUtility.ChangePennies); }
public void ShouldGetCorrectChangeNickels() { Order order = new Order(); order.Add(new BriarheartBurger()); RegisterUtility registerUtility = new RegisterUtility(order); Assert.Equal(0, registerUtility.ChangeNickels); registerUtility.CustomerNickels = 140; Assert.Equal("$0.00", registerUtility.ChangeOwed); Assert.Equal(0, registerUtility.ChangeNickels); registerUtility.CustomerNickels = 143; Assert.Equal("$0.07", registerUtility.ChangeOwed); Assert.Equal(1, registerUtility.ChangeNickels); }
public void ShouldGetCorrectChangeQuarters() { Order order = new Order(); order.Add(new BriarheartBurger()); RegisterUtility registerUtility = new RegisterUtility(order); Assert.Equal(0, registerUtility.ChangeQuarters); registerUtility.CustomerQuarters = 28; Assert.Equal("$0.00", registerUtility.ChangeOwed); Assert.Equal(0, registerUtility.ChangeQuarters); registerUtility.CustomerQuarters = 30; Assert.Equal("$0.42", registerUtility.ChangeOwed); Assert.Equal(1, registerUtility.ChangeQuarters); }
public void ShouldGetCorrectChangeHalfDollars() { Order order = new Order(); order.Add(new BriarheartBurger()); RegisterUtility registerUtility = new RegisterUtility(order); Assert.Equal(0, registerUtility.ChangeHalfDollars); registerUtility.CustomerHalfDollars = 14; Assert.Equal("$0.00", registerUtility.ChangeOwed); Assert.Equal(0, registerUtility.ChangeHalfDollars); registerUtility.CustomerHalfDollars = 16; Assert.Equal("$0.92", registerUtility.ChangeOwed); Assert.Equal(1, registerUtility.ChangeHalfDollars); }
public void ShouldGetCorrectChangeTwos() { Order order = new Order(); order.Add(new BriarheartBurger()); RegisterUtility registerUtility = new RegisterUtility(order); Assert.Equal(0, registerUtility.ChangeTwos); registerUtility.CustomerTwos = 3; Assert.Equal("$0.00", registerUtility.ChangeOwed); Assert.Equal(0, registerUtility.ChangeTwos); registerUtility.CustomerTwos = 5; Assert.Equal("$2.92", registerUtility.ChangeOwed); Assert.Equal(1, registerUtility.ChangeTwos); }
public void ShouldGetCorrectChangeTwenties() { Order order = new Order(); order.Add(new BriarheartBurger()); RegisterUtility registerUtility = new RegisterUtility(order); Assert.Equal(0, registerUtility.ChangeTwenties); registerUtility.CustomerTwenties = 1; Assert.Equal("$12.92", registerUtility.ChangeOwed); Assert.Equal(0, registerUtility.ChangeTwenties); registerUtility.CustomerTwenties = 2; Assert.Equal("$32.92", registerUtility.ChangeOwed); Assert.Equal(1, registerUtility.ChangeTwenties); }