Ejemplo n.º 1
0
        public static void TestBetterAllocation(AllocationTestCaseService.AllocationTestCases fTestCaseId)
        {
            //get the test case data from a test case service
            DriverAllocationTestCase theTestCase = AllocationTestCaseService.GetDriverAllocationTestCase(fTestCaseId);

            RunAllocationtestCase(theTestCase, fTestCaseId);
        }
Ejemplo n.º 2
0
        public static void TestBetterAllocationDriverListVariations()
        {
            List <DriverAllocationTestCase> theTestCaseList = AllocationTestCaseService.GetSingleorderDifferentRatingDriverTestCaseList();

            Console.WriteLine("\n************\nSTART OF Testing list of driver list variations with single order\n");
            foreach (DriverAllocationTestCase theTestCase in theTestCaseList)
            {
                RunAllocationtestCase(theTestCase, AllocationTestCaseService.AllocationTestCases.SingleorderDifferentRatingDriver);
            }
            Console.WriteLine("\nEND OF Testing list of driver list variations with single order\n************\n");
        }
Ejemplo n.º 3
0
        public static void TestDriverComparison()
        {
            List <DriverComparisonTestPair> testCases = AllocationTestCaseService.GetDriverComparisonTestPairs();
            List <int> failedTestCases = new List <int>();
            int        i = 0;

            Console.WriteLine("\n*********\nSTART OF testing driver pair comparisons");
            foreach (DriverComparisonTestPair testCase in testCases)
            {
                AllocationEngine.CandidateDriver selection = AllocationEngine.GetDeservingCandidateDriver(testCase.driver1, testCase.driver2);
                Console.WriteLine("Compared " + testCase.driver1.driverInfo.name + " and " + testCase.driver2.driverInfo.name + " and selected " + selection.driverInfo.name);
                if (selection.driverInfo.name != testCase.expectedSelectionDrivername)
                {
                    failedTestCases.Add(i);
                    Console.WriteLine("Wrong selection");
                }
                else
                {
                    Console.WriteLine("Right selection");
                }
                i++;
            }

            if (failedTestCases.Count > 0)
            {
                Console.Write("TestDriverComparison failed tests : ");
                foreach (int n in failedTestCases)
                {
                    Console.Write("driver pair " + n + ";");
                }
            }
            else
            {
                Console.WriteLine("All driver compare tests passed!!");
            }

            Assert.IsTrue(failedTestCases.Count == 0);
        }