public void InvalidConstructor_Test(string itemName, double price, string itemCatagory) { //arrange decimal priceAsDecimal = (decimal)price; //act VendingMachineSlot slot = new VendingMachineSlot(itemName, priceAsDecimal, itemCatagory); }
public void ItemCategory_test() { //arrange VendingMachineSlot slot = SetupHershys(); //act //assert Assert.AreEqual("Candy", slot.ItemCategory); }
public void ItemName_Test() { //arrange VendingMachineSlot slot = SetupHershys(); //act //assert Assert.AreEqual("Hershey's", slot.ItemName); }
public void Constructor_Test(string itemName, double price, string itemCatagory) { //arrange decimal priceAsDecimal = (decimal)price; //act VendingMachineSlot slot = new VendingMachineSlot(itemName, priceAsDecimal, itemCatagory); //assert Assert.AreEqual(priceAsDecimal, slot.Price, "The price of the slot was not set correctly. Check the constructor!"); }
public void QuantityRemaining_test() { //arrange VendingMachineSlot slot = SetupHershys(); //act slot.Pop(); //assert Assert.AreEqual("4", slot.QuantityRemainingDisplayString); }
public void ToString_Test() { //arrange VendingMachineSlot slot = SetupHershys(); //act string result = slot.ToString(); //assert Assert.AreEqual("5|$2.00|Hershey's", result); }
public void ItemCategory_SoldOut_test() { //arrange VendingMachineSlot slot = SetupHershys(); //act while (slot.Count > 0) { slot.Pop();//empty the slot } //assert Assert.AreEqual(null, slot.ItemCategory); }
public void QuantityRemaining_SoldOut_Test() { //arrange VendingMachineSlot slot = SetupHershys(); //act while (slot.Count > 0) { slot.Pop();//empty the slot } //assert Assert.AreEqual(VendingMachineSlot.DISPLAY_QUANTITY_SOLD_OUT, slot.QuantityRemainingDisplayString); }
public void ToString_SoldOut_Test() { //arrange VendingMachineSlot slot = SetupHershys(); //act while (slot.Count > 0) { slot.Pop();//empty the slot } string result = slot.ToString(); //assert Assert.AreEqual($"{VendingMachineSlot.DISPLAY_QUANTITY_SOLD_OUT}|$2.00|Hershey's", result); }
private MessageDataFiller Filler(IEntity shop, IInventoryPage page) { return(x => { x.Identity = shop.Identity; x.Unknown = 1; List <VendingMachineSlot> tempList = new List <VendingMachineSlot>(); foreach (IItem item in page.List().Values) { VendingMachineSlot temp = new VendingMachineSlot(); temp.ItemHighId = item.HighID; temp.ItemLowId = item.LowID; temp.Quality = item.Quality; tempList.Add(temp); } x.VendingMachineSlots = tempList.ToArray(); }); }
public void Initialize() { vms = new VendingMachineSlot(); bubbleGum = new VendingMachineItem("Bubble Gum", 2.00M); candyBar = new VendingMachineItem("Candy Bar", 2.50M); }