예제 #1
0
        public void Fees_Increase()
        {
            FeeTestArgs args              = CreateManyFees(0, 0, 0, MethodBase.GetCurrentMethod().Name);
            int         percent           = 5;
            FeeCache    cache             = new FeeCache();
            List <Fee>  listStandardFees  = cache.GetListFees(_standardFeeSchedNum, 0, 0).OrderBy(x => x.FeeNum).ToList();
            List <Fee>  listIncreasedFees = listStandardFees.Select(x => x.Copy()).ToList();

            listIncreasedFees = Fees.Increase(_standardFeeSchedNum, percent, 2, listIncreasedFees, 0, 0).OrderBy(x => x.FeeNum).ToList();
            foreach (Fee fee in listIncreasedFees)
            {
                Fee    expectedFee = cache.GetFee(fee.CodeNum, fee.FeeSched, fee.ClinicNum, fee.ProvNum);
                double amount      = fee.Amount / (1 + (double)percent / 100);
                amount = Math.Round(amount, 2);
                try {
                    Assert.AreEqual(expectedFee.Amount, amount);
                }
                catch (Exception e) {
                    throw new Exception("Failed for fee: " + expectedFee.FeeNum, e);
                }
            }
        }