示例#1
0
        public void TestLowestDeposit()
        {
            BudgetSheet sheet = new BudgetSheet();

            sheet.DepositMoney(5.0M);
            sheet.DepositMoney(400.0M);

            BudgetActivity testResult = sheet.ShowAccountActivity();

            Assert.AreEqual(0, testResult.Low);
        }
示例#2
0
        public void TestHighestDeposit()
        {
            //27Add a reference to the Budget_Book
            //28 change the BudgetSheet to public

            //29 Write the unit tests.
            BudgetSheet sheet = new BudgetSheet();

            sheet.DepositMoney(100.0M);
            sheet.DepositMoney(400.0M);

            BudgetActivity testResult = sheet.ShowAccountActivity();

            Assert.AreEqual(400.0M, testResult.High);
        }
示例#3
0
        public void TestAverageDeposit()
        {
            //27Add a reference to the Budget_Book
            //28 change the BudgetSheet to public

            //29 Write the unit tests.
            BudgetSheet sheet = new BudgetSheet();

            //sheet.DepositMoney(10.0M);
            //sheet.DepositMoney(10.0M);
            sheet.DepositMoney(10.3M);
            sheet.DepositMoney(10.3M);
            sheet.DepositMoney(10.7M);

            BudgetActivity testResult = sheet.ShowAccountActivity();

            // Assert.AreEqual(10.0M, testResult.Average);

            //29Problem: imperfect average.
            Assert.AreEqual(10.0M, testResult.Average);

            //Assert.AreEqual(10.433333333M, testResult.Average, 0.01M);
        }