public void GetDrinkDataTest() { Assert.AreEqual(_model.GetDrinkData().Count, 0); for (int i = 0; i < 10; i++) { _model.AddItem(i.ToString() + "d", i, "drink"); } Assert.AreEqual(_model.GetDrinkData().Count, 10); for (int i = 0; i < 10; i++) { Assert.AreEqual(_model.GetDrinkData()[i].Name, i.ToString() + "d"); Assert.AreEqual(_model.GetDrinkData()[i].Price, i); } }
public void ClickAndUseTest() { _model.SetOrderedName("dd"); _drinkModel.AddItem("dd", 10, "drink"); _drinkModel.AddItem("aa", 10, "addition"); _model.ClickAndUse(EzText.ORDER, 0, Nothing); Assert.AreEqual(_drinkModel.GetOrderedDrink(0).GetDrinkName(), "dd"); _model.SetOrderedName("aa"); _model.ClickAndUse(EzText.ORDER, 0, Nothing); Assert.AreEqual(_drinkModel.GetOrderedDrink(0).GetAdditionName(), "aa,"); _model.SelectedDrinkIndex = 1; _model.ClickAndUse(EzText.DELETE, 5, Nothing); Assert.AreEqual(_drinkModel.GetOrderedDrinkCount(), 1); _model.SelectedDrinkIndex = 0; _model.ClickAndUse(EzText.DELETE, 5, Nothing); Assert.AreEqual(_drinkModel.GetOrderedDrinkCount(), 0); _model.ClickAndUse("drink", 0, Nothing); Assert.AreEqual(_drinkModel.GetDrinkData().Count, 0); _model.ClickAndUse("addition", 0, Nothing); Assert.AreEqual(_drinkModel.GetDrinkAddition().Count, 0); }