Beispiel #1
0
        public void JobParserTestMethod()
        {
            bool    extraMargin = true;
            bool    taxExempt   = false;
            string  description = "envelopes";
            decimal price       = 556.40m;

            JobParser job1 = new JobParser("../../JobFiles/Job1.txt");

            job1.LoadJobElements();

            JobComponents temp = job1.getJob(0);

            Assert.AreEqual(description, temp.getJobType);
            Assert.AreEqual(extraMargin, temp.getIsExtraMargin);
            Assert.AreEqual(price, temp.getPrice);
            Assert.AreEqual(taxExempt, temp.getIsTaxExempt);

            extraMargin = true;
            taxExempt   = true;
            description = "letterhead";
            price       = 1983.37m;

            temp = job1.getJob(1);

            Assert.AreEqual(description, temp.getJobType);
            Assert.AreEqual(extraMargin, temp.getIsExtraMargin);
            Assert.AreEqual(price, temp.getPrice);
            Assert.AreEqual(taxExempt, temp.getIsTaxExempt);
        }
Beispiel #2
0
        static void ProcessJobs(int index)
        {
            Console.WriteLine("\nJob {0} Output\n", index);
            JobParser job1 = new JobParser($"../../JobFiles/Job{index}.txt");

            job1.LoadJobElements();

            JobComponents        temp = job1.getJob(0);
            List <JobComponents> test = job1.getJobAllElements().ToList();

            JobCalculator pCalc = new JobCalculator(temp, test);

            pCalc.DumpOutput(index);
        }
Beispiel #3
0
        public void Job1JobCalculatorTestMethod()
        {
            JobParser job1 = new JobParser("../../JobFiles/Job1.txt");

            job1.LoadJobElements();

            JobComponents        temp  = job1.getJob(0);
            List <JobComponents> test  = job1.getJobAllElements().ToList();
            JobCalculator        pCalc = new JobCalculator(temp, test);

            pCalc.DumpOutput(1);

            decimal total = 2940.30m;

            Assert.AreEqual(total, pCalc.CalculateTotal());
        }