Exemplo n.º 1
0
        public void CommandCancelCallsCancelOnQueuedJobAndSetsStateToCanceled()
        {
            var job = new Job();

            JobRepository.Add(job);
            CommandRepository.Add(new Command()
            {
                Type = CommandType.Cancel, Urn = job.Urn, Username = "******"
            });

            Executor.Pulse();

            Assert.That(JobRepository.Get(job.Urn).Plan.GetState(), Is.EqualTo(ExecutionState.Canceled));
            Assert.That(JobRepository.ActiveJobs().Count(), Is.EqualTo(0));
        }
Exemplo n.º 2
0
        public void CheckSaveInterceptor()
        {
            var commandRepository = new InMemoryCommandRepository();

            commandRepository.Add(new Parent(), new AddCommandInterceptor());
            commandRepository.Save(new SaveInterceptor());
        }