示例#1
0
        public void IfTwoNickelsAreInsertedNickleCountEqualsTwo()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Nickle, CoinDiameter.Nickle);
            moneyMangerViewModel.Insert(CoinWeight.Nickle, CoinDiameter.Nickle);

            Assert.AreEqual(2, moneyMangerViewModel.NickleCount);
        }
示例#2
0
        public void InsertingQuaterDimeAndNickleReturns40Cents()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Nickle, CoinDiameter.Nickle);
            moneyMangerViewModel.Insert(CoinWeight.Dime, CoinDiameter.Dime);
            Assert.AreEqual(0.40m, moneyMangerViewModel.CustomerAmountInserted);
        }
示例#3
0
        public void IfTwoDimesAreInsertedDimeCountEqualsTwo()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Dime, CoinDiameter.Dime);
            moneyMangerViewModel.Insert(CoinWeight.Dime, CoinDiameter.Dime);

            Assert.AreEqual(2, moneyMangerViewModel.DimeCount);
        }
示例#4
0
        public void IfTwoQuatersAreInsertedQuaterCountEqualsTwo()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);

            Assert.AreEqual(2, moneyMangerViewModel.QuaterCount);
        }
示例#5
0
        public void IsInsertedValueEqualToOrGreaterSelectedItemPriceShouldReturnTrue()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);

            moneyMangerViewModel.SelectedItemsPrice(1.00m);

            Assert.AreEqual(true, moneyMangerViewModel.IsInsertedValueGreaterThanOrEqualToSelectedItemsPrice());
        }
示例#6
0
        public void TranactionReturnsChange()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);

            moneyMangerViewModel.SelectedItemsPrice(1.00m);
            moneyMangerViewModel.Tranaction();
            Assert.AreEqual(0.25m, moneyMangerViewModel.CustomerChangeToReturn);
        }
示例#7
0
        public void InsertingQuaterWeightAndDiameterReturns25Cents()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Quarter, CoinDiameter.Quarter);
            Assert.AreEqual(0.25m, moneyMangerViewModel.CustomerAmountInserted);
        }
示例#8
0
        public void InsertingNickelWeightAndDiameterReturns5Cents()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Nickle, CoinDiameter.Nickle);
            Assert.AreEqual(0.05m, moneyMangerViewModel.CustomerAmountInserted);
        }
示例#9
0
        public void InsertingDimeWeightAndDiameterReturns10Cents()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.Dime, CoinDiameter.Dime);
            Assert.AreEqual(0.10m, moneyMangerViewModel.CustomerAmountInserted);
        }
示例#10
0
        public void IfBadCoinIsInsertedBadCoinCountEqualsOne()
        {
            MoneyMangerViewModel moneyMangerViewModel = new MoneyMangerViewModel();

            moneyMangerViewModel.Insert(CoinWeight.BadCoin, CoinDiameter.BadCoin);


            Assert.AreEqual(1, moneyMangerViewModel.BadCoinCount);
        }