示例#1
0
        public void BackgroundServiceJobFailureEvent()
        {
            BackgroundService.SetWorker(WorkerLoader.CreateInstance("SingleQQ"));
            BackgroundService.JobFailure += RegisterJobFailure;
            BackgroundService.RequestNewJob(
                "CalculateBoundWaveFunction", new Dictionary <string, string>());

            WaitForJobFailure(2000);

            Assert.IsTrue(HasRegisteredJobFailure);
        }
        public void NewJobInBetweenJobsOfPrevious()
        {
            BackgroundService = CreateDummyBackgroundService();
            BackgroundService.ProcessBatchFile(DummyWorker.CreateDummyBatchFile(),
                                               EmptyDictionary);

            Thread.Sleep(110);

            BackgroundService.RequestNewJob("", new Dictionary <string, string>());

            while (NumberJobsFinished < 2)
            {
                Thread.Sleep(10);
            }

            Assert.IsTrue(NumberJobsFinished == 2);

            Assert_DeclineWhileBusyException_Thrown();
        }