예제 #1
0
        private IActionProcessor GetProcessor(bool start = true, bool withRecovery = false)
        {
            var processor = new ActionProcessor(_requirements, Sys);

            if (start)
            {
                processor.Start(withRecovery);
            }

            return(processor);
        }
예제 #2
0
        private IActionProcessor GetProcessor(bool start = true, bool withRecovery = false)
        {
            var requirements = new TestProcessorRequirements(new PreliminaryContractActionPipelineConfiguration(_kernel), _requestPersistence, _statePersistence, null, _responseObserver);

            var processor = new ActionProcessor(requirements, Sys);

            if (start)
            {
                processor.Start(withRecovery);
            }

            return(processor);
        }
예제 #3
0
        public void Requesting_an_action_that_requires_creation_via_the_action_factory_should_succeed()
        {
            var kernel           = new StandardKernel();
            var statePersistence = new TestActionIoC();

            kernel.Bind <TestActionIoC>().ToConstant(statePersistence);

            var requirements = new TestRequirements(kernel);
            var processor    = new ActionProcessor(requirements, Sys);

            processor.Start(false);
            var response = processor.ProcessAction(new ActionRequest <IntegerPayload>(nameof(Add), IntegerPayload.New(0))).Result;

            AwaitAssert(() => {
                Assert.AreEqual(1, (statePersistence?.LastPayload as IntegerPayload)?.Value);
            },
                        TimeSpan.FromSeconds(1));
        }