public async Task SaveTipTransaction_ValidTip_PositiveTipTransactionIdAsync() { var myCalculatorViewModel = new CalculatorPageViewModel(myCalculator, myTipCalcTransaction, myTipDatabase) { TotalTxt = "100.00", TipPercent = 10, }; int result = await myCalculatorViewModel.SaveTipTransactionAsync(); Assert.IsTrue(result > 0); }
public async Task SaveTipTransaction_ValidTip_CalculatorAndTransactionValuesMatchAsync() { var myCalculatorViewModel = new CalculatorPageViewModel(myCalculator, myTipCalcTransaction, myTipDatabase) { TotalTxt = "100.00", TipPercent = 10, }; int result = await myCalculatorViewModel.SaveTipTransactionAsync(); Assert.AreEqual(myCalculator.GrandTotal, myTipCalcTransaction.GrandTotal); Assert.AreEqual(myCalculator.NumberOfPersons, myTipCalcTransaction.NumOfPersons); Assert.AreEqual(myCalculator.Tip, myTipCalcTransaction.Tip); Assert.AreEqual(myCalculator.TipPercent, myTipCalcTransaction.TipPercent); Assert.AreEqual(myCalculator.Total, myTipCalcTransaction.Total); Assert.AreEqual(myCalculator.TotalPerPerson, myTipCalcTransaction.TotalPerPerson); Assert.AreEqual(false, myTipCalcTransaction.Split); Assert.IsNotNull(myTipCalcTransaction.Split); }