示例#1
0
        private String Test8()
        {
            //Navigate to http://adam.goucher.ca/parkcalc/index.php
            ParkingCalculation calculation = new ParkingCalculation();

            //Select the Short­Term Parking​ option from the Choose a Lot d​ropdown
            calculation.ParkingLot("Short-Term Parking");

            //Enter 10:00​ and 01 / 40 / 2014 ​in the Choose Entry Date and Time s​ection
            calculation.entryDetails.Time("10:00");
            calculation.entryDetails.Date("01/40/2014");

            //Select the PM ​option in the Choose Entry Date and Time ​section
            calculation.entryDetails.AMPM("pm");

            //Enter 11:00​ and 01 / 40 / 2014 ​in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.Time("11:00");
            calculation.leavingDetails.Date("01/40/2014");

            //Select the PM ​option in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.AMPM("pm");

            //Click Calculate
            calculation.Submit();

            //Make sure this input yields an ERROR
            if (calculation.YieldsError())
            {
                return "-";
            }
            else
            {
                return "FAILED";
            }
        }
示例#2
0
        private String Test6()
        {
            //Navigate to http://adam.goucher.ca/parkcalc/index.php
            ParkingCalculation calculation = new ParkingCalculation();

            //Select the Short­Term Parking​ option from the Choose a Lot d​ropdown
            calculation.ParkingLot("Short-Term Parking");

            //Enter 11:00​ and 01 / 01 / 2014 ​in the Choose Entry Date and Time s​ection
            calculation.entryDetails.Time("11:00");
            calculation.entryDetails.Date("01/01/2014");

            //Select the PM ​option in the Choose Entry Date and Time ​section
            calculation.entryDetails.AMPM("pm");

            //Enter 10:00​ and 01 / 01 / 2014 ​in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.Time("10:00");
            calculation.leavingDetails.Date("01/01/2014");

            //Select the PM ​option in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.AMPM("pm");

            //Click Calculate
            calculation.Submit();

            //Check that the following error message appears: ERROR! YOUR EXIT DATE OR TIME IS BEFORE YOUR ENTRY DATE OR TIME
            if (calculation.ErrorMessage("ERROR! YOUR EXIT DATE OR TIME IS BEFORE YOUR ENTRY DATE OR TIME"))
            {
                return "-";
            }
            else
            {
                return "FAILED";
            }
        }
示例#3
0
        private String Test2()
        {
            //Navigate to http://adam.goucher.ca/parkcalc/index.php
            ParkingCalculation calculation = new ParkingCalculation();

            //Select the Long­ Term Surface Parking ​option from the Choose a Lot d​ropdown
            calculation.ParkingLot("Long-Term Surface Parking");

            //Click on the Calendar Icon ​in the Choose Entry Date and Time s​ection
            //Select 01 / 01 / 2014 ​in the new window that appears
            calculation.entryDetails.Date(1, 1, 2014);

            //Click on the Calendar Icon ​in the Choose Leaving Date and Time s​ection
            //Select 02 / 01 / 2014 ​in the new window that appears
            calculation.leavingDetails.Date(1, 2, 2014);

            //Click Calculate
            calculation.Submit();

            //Check that the COST ​is equal to $ 270.00
            //Check that the duration of stay is equal to (31 Days, 0 Hours, 0 Minutes)
            if (calculation.ParkingDuration("(31 Days, 0 Hours, 0 Minutes)") && calculation.FinalCost("$ 270.00"))
            {
                return "-";
            }
            else
            {
                return "FAILED";
            }
        }
示例#4
0
        private String Test4()
        {
            //Navigate to http://adam.goucher.ca/parkcalc/index.php
            ParkingCalculation calculation = new ParkingCalculation();

            //Select the Short­Term Parking​ option from the Choose a Lot d​ropdown
            calculation.ParkingLot("Short-Term Parking");

            //Enter 10:00​ and 01 / 01 / 2014 ​in the Choose Entry Date and Time s​ection
            calculation.entryDetails.Time("10:00");
            calculation.entryDetails.Date("01/01/2014");

            //Select the PM ​option in the Choose Entry Date and Time ​section
            calculation.entryDetails.AMPM("pm");

            //Enter 11:00​ and 01 / 01 / 2014 ​in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.Time("11:00");
            calculation.leavingDetails.Date("01/01/2014");

            //Select the PM ​option in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.AMPM("pm");

            //Click Calculate
            calculation.Submit();

            //Check to make sure both PM radio buttons remained selected, and entry time = 10:00, and leaving time  = 11:00
            if (calculation.entryDetails.AMPM().ToString() == "PM" && calculation.leavingDetails.AMPM().ToString() == "PM" && calculation.entryDetails.Time().ToString() == "10:00" && calculation.leavingDetails.Time().ToString() == "11:00")
            {
                return "-";
            }
            else
            {
                return "FAILED";
            }
        }
示例#5
0
        private String Test1()
        {
            //Navigate to http://adam.goucher.ca/parkcalc/index.php
            ParkingCalculation calculation = new ParkingCalculation();

            //Select the Short­Term Parking​ option from the Choose a Lot d​ropdown
            calculation.ParkingLot("Short-Term Parking");

            //Enter 10:00​ and 01 / 01 / 2014 ​in the Choose Entry Date and Time s​ection
            calculation.entryDetails.Time("10:00");
            calculation.entryDetails.Date("01/01/2014");

            //Select the PM ​option in the Choose Entry Date and Time ​section
            calculation.entryDetails.AMPM("pm");

            //Enter 11:00​ and 01 / 01 / 2014 ​in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.Time("11:00");
            calculation.leavingDetails.Date("01/01/2014");

            //Select the PM ​option in the Choose Leaving Date and Time s​ection
            calculation.leavingDetails.AMPM("pm");

            //Click Calculate
            calculation.Submit();

            //Check that the COST ​is equal to $ 2.00
            //Check that the duration of stay is equal to (0 Days, 1 Hours, 0 Minutes)
            if (calculation.ParkingDuration("(0 Days, 1 Hours, 0 Minutes)") && calculation.FinalCost("$ 2.00"))
            {
                return "-";
            }
            else
            {
                return "FAILED";
            }
        }