コード例 #1
0
        public void AddIndividualExpenses()
        {
            TripExpense tripExp = new TripExpense();

            tripExp.MaxPeople = 2;
            tripExp.AddExpenses(0, 5.03m);
            tripExp.AddExpenses(0, 3.01m);
            tripExp.AddExpenses(0, 2.03m);
            tripExp.AddExpenses(1, 5.00m);
            tripExp.AddExpenses(1, 5.00m);
            tripExp.AddExpenses(1, 5.00m);
            Assert.IsTrue(tripExp.CountExpense() == 6);
            Assert.IsTrue(tripExp.IndividualExpense(0) == 10.07m);
            Assert.IsTrue(tripExp.IndividualExpense(1) == 15m);
            ;
        }