예제 #1
0
        public void Setup()
        {
            //Arrange
            validationService  = new InputValidation();
            babySitterContract = new BabySitterContract();
            calculator         = new PaymentCalculator(validationService);

            listOfRates = new List <Rate>();
            Rate fifteenDollarRate = new Rate()
            {
                rateStartTime = (int)Time.FivePm, rateEndTime = (int)Time.ElevenPm, dollarsPerHour = 15
            };
            Rate twentyDollarRate = new Rate()
            {
                rateStartTime = (int)Time.ElevenPm, rateEndTime = (int)Time.FourAm, dollarsPerHour = 20
            };

            listOfRates.Add(fifteenDollarRate);
            listOfRates.Add(twentyDollarRate);
            babySitterContract.Rates = listOfRates;

            // Initialize Family A Rate List
            FamilyA_Rates = new List <Rate>();
            FamilyA_Rates.Add(fifteenDollarRate);
            FamilyA_Rates.Add(twentyDollarRate);

            // Initialize Family B Rate List
            FamilyB_Rates = new List <Rate>();
            Rate twelveDollarsAnHour = new Rate()
            {
                rateStartTime = (int)Time.FivePm, rateEndTime = (int)Time.TenPm, dollarsPerHour = 12
            };
            Rate eightDollarsAnHour = new Rate()
            {
                rateStartTime = (int)Time.TenPm, rateEndTime = (int)Time.Midnight, dollarsPerHour = 8
            };
            Rate sixteenDollarsAnHour = new Rate()
            {
                rateStartTime = (int)Time.Midnight, rateEndTime = (int)Time.FourAm, dollarsPerHour = 16
            };

            FamilyB_Rates.Add(twelveDollarsAnHour);
            FamilyB_Rates.Add(eightDollarsAnHour);
            FamilyB_Rates.Add(sixteenDollarsAnHour);

            // Initialize Family C Rate List
            FamilyC_Rates = new List <Rate>();
            Rate twentyOneDollarsAnHour = new Rate()
            {
                rateStartTime = (int)Time.FivePm, rateEndTime = (int)Time.NinePm, dollarsPerHour = 21
            };

            FamilyC_Rates.Add(fifteenDollarRate);
            FamilyC_Rates.Add(twentyOneDollarsAnHour);
        }
예제 #2
0
 public PaymentCalculator(IBabySitterValidation validation)
 {
     this.validation = validation;
 }