예제 #1
0
        public void AddCustomerTest()
        {
            Fixture  fixtureGen   = new Fixture();
            Customer bob          = fixtureGen.Build <Customer>().Without(x => x.requestedJobs).Create();
            Job      requestedJob = testingQueue.jobList.First();
            var      newTask      = testingQueue.AddCustomer(new Task {
                customer = bob, job = requestedJob, timePrice = 1.2
            });

            Assert.Equal(newTask.job, requestedJob);
            Assert.Equal(newTask.customer, bob);
            Assert.Equal(newTask.timePrice, 1.2);
            Assert.Contains(testingQueue.customerList, item => item == bob);
            Assert.Contains(testingQueue.queueStatus.internalQueue, item => item == newTask);
        }
예제 #2
0
        public Task CreateNewTask([FromBody] Task value)
        {
            //TODO: Get customer data from authentication, that's what it's for.
            var foo = queueService.jobList.First(item => item.JobId == value.jobId);

            return(queueService.AddCustomer(value));
        }