Пример #1
0
        public void WhenCalculatingFullDayPayReturnsMaxPay()
        {
            var testStart  = 1;
            var testEnd    = 12;
            var calculator = new PayCalculator(testStart, testEnd);

            var result = calculator.CalculatePay();

            result.ShouldBe(109);
        }
Пример #2
0
        public void WhenCalculatingAfternoonHoursReturnsAfternoonRateTimesTotal()
        {
            var testStart  = 1;
            var testEnd    = 4;
            var calculator = new PayCalculator(testStart, testEnd);

            var result = calculator.CalculatePay();

            result.ShouldBe(3 * 7);
        }
Пример #3
0
        public void WhenCalculatingNightAndEveningPayReturnsEveningRatePlusNightRate()
        {
            var testStart  = 9;
            var testEnd    = 11;
            var calculator = new PayCalculator(testStart, testEnd);

            var result = calculator.CalculatePay();

            result.ShouldBe(11 + 13);
        }
Пример #4
0
        public void WhenCalculationNightPayReturnsNightRateTimesTotalHours()
        {
            var testStart  = 10;
            var testEnd    = 11;
            var calculator = new PayCalculator(testStart, testEnd);

            var result = calculator.CalculatePay();

            result.ShouldBe(1 * 13);
        }
Пример #5
0
        public void WhenCalculatingEveningPayReturnsEveningRateTimesTotalHours()
        {
            var testStart  = 5;
            var testEnd    = 8;
            var calculator = new PayCalculator(testStart, testEnd);

            var result = calculator.CalculatePay();

            result.ShouldBe(3 * 11);
        }
Пример #6
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Pay Calculator!");
            Console.Write("Please Enter Starting Hour: ");
            var startingHour = Console.ReadLine();

            Console.Write("Please Enter Ending Hour: ");
            var endingHour = Console.ReadLine();

            var calculator = new PayCalculator(int.Parse(startingHour), int.Parse(endingHour));

            var payAmount = calculator.CalculatePay();

            Console.WriteLine($"This babysitter is owed: ${payAmount}.00");
        }
Пример #7
0
 public float CalculatePay()
 {
     return(_payCalculator.CalculatePay(_employee));
 }