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

CommandPublish_CommandHasCompletedAction_ActionCalled() private méthode

private CommandPublish_CommandHasCompletedAction_ActionCalled ( ) : void
Résultat void
        public void CommandPublish_CommandHasCompletedAction_ActionCalled()
        {
            var actionCalled = false;
            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(CommandState.New, interpretResponseAction: r => true, completeAction: i =>
            {
                actionCalled = true;
                resetEvent.Set();
            });
            processor.PublishCommand(command);
            inputSource.OnNext(new ProcessorInput());

            resetEvent.Wait();

            Assert.IsTrue(actionCalled);
        }
CommandProcessorTests