Exemplo n.º 1
0
        public void JobComponentCreationTestMethod()
        {
            string  description = "envelope";
            decimal cost        = 500.00m;
            bool    taxExempt   = false;
            bool    extraMargin = true;

            JobComponents job1 = new JobComponents(description, cost, taxExempt, extraMargin);

            Assert.AreEqual(description, job1.getJobType);
            Assert.AreEqual(cost, job1.getCost);
            Assert.AreEqual(taxExempt, job1.getIsTaxExempt);
            Assert.AreEqual(extraMargin, job1.getIsExtraMargin);
            Assert.AreEqual(535.00m, job1.getPrice);

            bool   taxExempt2   = true;
            string description2 = "letterhead";

            JobComponents job2 = new JobComponents(description2, cost, taxExempt2);

            Assert.AreEqual(description2, job2.getJobType);
            Assert.AreEqual(cost, job2.getCost);
            Assert.AreEqual(taxExempt2, job2.getIsTaxExempt);
            Assert.AreEqual(false, job2.getIsExtraMargin);
            Assert.AreEqual(500.00m, job2.getPrice);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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());
        }
Exemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;

        if (timer > timerDuration && !submittingIdea)
        {
            //Debug.Log("Started Coroutine");

            createJob        = true;
            doneCreatingJobs = false;
            StartCoroutine(GetRequest("https://testserversoubra.herokuapp.com/listAllJobs"));

            timer = 0;
        }

        if (createJob && !doneCreatingJobs && start)
        {
            //Debug.Log(Jlist.job.Count);
            for (int i = 0; i < Jlist.job.Count; i++)
            {
                if (jobsAdded.Contains(Jlist.job[i].jobID))
                {
                    //Debug.Log("Job Already Created");
                }
                else
                {
                    GameObject temp = Instantiate(jobPrefab, parent.transform);
                    allJobs.Add(temp);
                    JobComponents tempR = temp.GetComponent <JobComponents>();

                    tempR.jobID           = Jlist.job[i].jobID;
                    tempR.title.text      = Jlist.job[i].jobTitle;
                    tempR.department.text = Jlist.job[i].jobDepartment;
                    tempR.property.text   = Jlist.job[i].jobProperty;

                    temp.transform.SetParent(parent);

                    jobsAdded.Add(Jlist.job[i].jobID);
                    SortChildren();
                }
            }

            createJob        = false;
            doneCreatingJobs = true;
        }
    }