CodeValue.CodeCommander.Tests.CommandProcessorTests.CommandPublishGeneric_CommandGotFullfillmentWithReturnValue_ReturnValue C# (CSharp) Méthode

CommandPublishGeneric_CommandGotFullfillmentWithReturnValue_ReturnValue() private méthode

        public void CommandPublishGeneric_CommandGotFullfillmentWithReturnValue_ReturnValue()
        {
            var resetEvent = new ManualResetEventSlim(false);
            var inputSource = new Subject<ProcessorInput>();

            var fakeFilterManager = A.Fake<IFilterManager>();
            A.CallTo(() => fakeFilterManager.Process(A<CommandBase>.Ignored)).Returns(true);

            var processor = new CommandProcessor(inputSource, fakeFilterManager);
            var command = new TestCommand<bool>(CommandState.New, returnValue:true, interpretResponseAction: r => true, fullfillmentAction: i => resetEvent.Set());
            processor.PublishCommand(command);
            inputSource.OnNext(new ProcessorInput());

            resetEvent.Wait();

            Assert.IsTrue(command.ReturnValue);
        }
CommandProcessorTests