Beispiel #1
0
        public void AddWorkerNode(Uri workerNodeUri)
        {
            var node = new WorkerNode
            {
                Url = workerNodeUri
            };

            _nodeRepository.AddWorkerNode(node);
        }
Beispiel #2
0
        public void ShouldBeAbleToSendAQueuedJob()
        {
            var jobQueueItem = new JobQueueItem
            {
                JobId      = Guid.NewGuid(),
                Name       = "Name Test",
                CreatedBy  = "Created By Test",
                Serialized = "Serialized Test",
                Type       = "Type Test"
            };

            WorkerNodeRepository.AddWorkerNode(_workerNode);

            JobManager.AddItemToJobQueue(jobQueueItem);

            JobManager.AssignJobToWorkerNodes();

            JobRepository.GetAllItemsInJobQueue().Count.Should().Be(0);
            JobRepository.GetAllJobs().Count.Should().Be(1);
        }
Beispiel #3
0
        public void ShouldBeAbleToCancelJobOnNode()
        {
            var jobQueueItem = new JobQueueItem
            {
                JobId      = Guid.NewGuid(),
                Name       = "Name Test",
                CreatedBy  = "Created By Test",
                Serialized = "Serialized Test",
                Type       = "Type Test"
            };

            NodeRepository.AddWorkerNode(_workerNode);

            JobRepository.AddItemToJobQueue(jobQueueItem);

            JobRepository.AssignJobToWorkerNode();

            HttpSender.CallToWorkerNodes.Clear();
            ManagerController.CancelJobByJobId(jobQueueItem.JobId);

            HttpSender.CallToWorkerNodes.Count.Should().Be.EqualTo(1);
        }