コード例 #1
0
        public void CalculateTaxes_ReturnCorrectResult_whenAddingOneItem(double taxe, int quantity, double expected)
        {
            //Fixture setup
            var            shoppingCart = GetShoppingCartWithOneItem(taxe, quantity);
            calculateTaxes calTaxes     = new calculateTaxes(shoppingCart);
            //Exercise system
            var actual = calTaxes.CalculateTaxes();

            //verify outcome
            Assert.AreEqual(actual, expected);
        }
コード例 #2
0
        public void CalculateTaxes_ReturnCorrectResult_WithManyItems(double[] taxes, int[] quantities, double expected)
        {
            //Fixture setup
            var            shoppingCart = GetShoppingCartWithManyItems(taxes, quantities);
            calculateTaxes calTaxes     = new calculateTaxes(shoppingCart);
            //Exercise system
            var actual = calTaxes.CalculateTaxes();

            //verify outcome
            Assert.AreEqual(actual, expected);
        }
コード例 #3
0
        public void CalculateTaxes_ReturnZero_WithEmptyCrat()
        {
            //Fixture setup
            var            shoppingCart = GetShoppingCartWithNoItems();
            calculateTaxes calTaxes     = new calculateTaxes(shoppingCart);
            //Exercise system
            var actual = calTaxes.CalculateTaxes();

            //verify outcome
            Assert.AreEqual(actual, 0);
        }