Beispiel #1
0
        public void GetTheGun()
        {
            VendingMachineViewModel vendingMachineViewModel = new VendingMachineViewModel();

            vendingMachineViewModel.Refill();
            vendingMachineViewModel.InsertChangeIntoMachine(Models.CoinWeight.BadCoin, Models.CoinDiameter.BadCoin);
            vendingMachineViewModel.Purchase(vendingMachineViewModel.Items[3]);
            Assert.AreEqual(0, vendingMachineViewModel.Items[3].Quantity);
        }
Beispiel #2
0
        public void PortalGunRefillsToOne()
        {
            VendingMachineViewModel vendingMachineViewModel = new VendingMachineViewModel();

            vendingMachineViewModel.Refill();
            Assert.AreEqual(15, vendingMachineViewModel.Items[0].Quantity);
            Assert.AreEqual(15, vendingMachineViewModel.Items[1].Quantity);
            Assert.AreEqual(15, vendingMachineViewModel.Items[2].Quantity);
            Assert.AreEqual(1, vendingMachineViewModel.Items[3].Quantity);
        }
Beispiel #3
0
        public void RefillAdds15QuantityToEachExceptPortalGunItem()
        {
            VendingMachineViewModel vendingMachineViewModel = new VendingMachineViewModel();

            vendingMachineViewModel.Refill();
            Assert.AreEqual(15, vendingMachineViewModel.Items[0].Quantity);
            Assert.AreEqual(15, vendingMachineViewModel.Items[1].Quantity);
            Assert.AreEqual(15, vendingMachineViewModel.Items[2].Quantity);
            Assert.AreEqual(1, vendingMachineViewModel.Items[3].Quantity);
        }
Beispiel #4
0
        public void EmptySetsQuantityToZero()
        {
            VendingMachineViewModel vendingMachineViewModel = new VendingMachineViewModel();

            vendingMachineViewModel.Refill();
            vendingMachineViewModel.Empty();

            Assert.Multiple(() =>
            {
                Assert.AreEqual(0, vendingMachineViewModel.Items[0].Quantity);
                Assert.AreEqual(0, vendingMachineViewModel.Items[1].Quantity);
                Assert.AreEqual(0, vendingMachineViewModel.Items[2].Quantity);
                Assert.AreEqual(0, vendingMachineViewModel.Items[3].Quantity);
            });
        }
Beispiel #5
0
 public void Execute(object parameter)
 {
     vm.Refill();
 }
 private void OnClick_Refill(object sender, RoutedEventArgs e)
 {
     _rickAndMortysVendingMachine.Refill();
 }