private CommandPublish_CommandHasFullfillmentAction_ActionCalled ( ) : void | ||
Résultat | void |
public void CommandPublish_CommandHasFullfillmentAction_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, fullfillmentAction: i =>
{
actionCalled
=
true;
resetEvent
.
Set
();
});
processor.PublishCommand(command);
inputSource.OnNext(new ProcessorInput());
resetEvent.Wait();
Assert.IsTrue(actionCalled);
}