Exemple #1
0
        public void DispenseChange4570Test()
        {
            //Arrange
            Catering testObj = new Catering();

            testObj.InitializeCateringItems();

            //Act
            string result = testObj.DispenseChange(45.70M);

            //Assert
            Assert.AreEqual("Change is: 2 Twenty Dollar Bills, 1 Five Dollar Bill, 2 Quarters, 2 Dimes.", result);
        }
Exemple #2
0
        public void MakePurchaseSuccesfulPurchaseTest()
        {
            //Arrange
            Catering testObj = new Catering();

            testObj.CurrentAccountBalance = 75;
            testObj.InitializeCateringItems();

            //Act
            string result = testObj.MakePurchase("B1", 50);

            //Assert
            Assert.AreEqual("Purchase was made successfully", result);
        }
Exemple #3
0
        public void MakePurchaseNotEnoughMoneyTest()
        {
            //Arrange
            Catering testObj = new Catering();

            testObj.CurrentAccountBalance = 1;
            testObj.InitializeCateringItems();

            //Act
            string result = testObj.MakePurchase("B1", 1);

            //Assert
            Assert.AreEqual("Not enough money in account to make purchase", result);
        }
Exemple #4
0
        public void MakePurchaseNotEnoughInventoryTest()
        {
            //Arrange
            Catering testObj = new Catering();

            testObj.CurrentAccountBalance = 4500;
            testObj.InitializeCateringItems();

            //Act
            string result = testObj.MakePurchase("B1", 60);

            //Assert
            Assert.AreEqual("Not enough of ordered product in inventory", result);
        }
Exemple #5
0
        public void MakePurchaseInvalidIdTest()
        {
            //Arrange
            Catering testObj = new Catering();

            testObj.CurrentAccountBalance = 4500;
            testObj.InitializeCateringItems();

            //Act
            string result = testObj.MakePurchase("C1", 10);

            //Assert
            Assert.AreEqual("Invalid Item ID", result);
        }
Exemple #6
0
        //[DataRow("Change is: 1 Hundred Dollar Bills, 1 Twenty Dollar Bills, 1 Ten Dollar Bills," +
        //    "1 Five Dollar Bills, 1 One Dolar Bills, 1 Quarters, 1 Dimes, 1 Nickels, ", new decimal 136.40M)]
        public void DispenseChangeAllTypesTest()
        {
            //Arrange
            Catering testObj = new Catering();

            testObj.InitializeCateringItems();

            //Act
            string result = testObj.DispenseChange(136.40M);

            //Assert
            Assert.AreEqual("Change is: 1 Hundred Dollar Bill, 1 Twenty Dollar Bill, 1 Ten Dollar Bill," +
                            " 1 Five Dollar Bill, 1 One Dollar Bill, 1 Quarter, 1 Dime, 1 Nickel.", result);
        }