public CommandSimplePipelineShould() { _command = Fixture.Create <Command>(); _processor = MockCommandProcessor(_command); _pipeline = new CommandSimplePipeline <Command>(_processor.Object); }
public InMemoryCommandBus(ICommandPipeline handler) { Precondition.For(() => handler).NotNull(); this.handler = handler; subject.Subscribe(async msg => await HandleCommand(msg)); }
private async Task <CommandBusResult> Execute(ICommandPipeline pipeline, ICommand cmd) { InMemoryCommandBus sut = GetSut(pipeline); CommandBusResult result = await sut.EnqueueAsync(cmd); return(result); }
public void ItThrowsWhenHandlerIsNull() { var repo = A.Fake <IDomainObjectRepository>(); ICommandPipeline pipeline = null; Assert.Throws <ArgumentNullException>(() => GetSut(pipeline)); }
public InMemoryCommandBus(ICommandPipeline handler, ILoggerFactory loggerFactory) : base(loggerFactory) { Precondition.For(() => handler).NotNull(); logger = loggerFactory.CreateLogger <InMemoryCommandBus>(); this.handler = handler; subject.Subscribe(async msg => await HandleCommand(msg)); }
public CommandSequentialPipelineShould() { _command = Fixture.Create <Command>(); _preProcessor = MockCommandPreProcessor(_command); _processor = MockCommandProcessor(_command); _postProcessor = MockCommandPostProcessor(_command); _pipeline = BuildPipeline(new[] { _preProcessor }, _processor, new[] { _postProcessor }); }
public CommandFullPipelineShould() { _command = Fixture.Create <Command>(); _behaviour = MockCommandBehaviour(_command); _preProcessor = MockCommandPreProcessor(_command); _processor = MockCommandProcessor(_command); _postProcessor = MockCommandPostProcessor(_command); _pipeline = BuildPipeline(new[] { _behaviour }, new[] { _preProcessor }, _processor, new[] { _postProcessor }); }
private Task <CommandBusResult> Execute(ICommandPipeline pipeline, ICommand command) { InMemoryCommandBus bus = GetSut(pipeline); bus.WithCondition(i => { var temp = i as SampleCommand; return(temp.Value == 42); }); return(bus.EnqueueAsync(command)); }
protected DefaultCommandController(ICommandPipeline commandPipeline, ICommandLocator commandLocator) { _commandPipeline = commandPipeline; _commandLocator = commandLocator; }
public CommandController(ICommandPipeline commandPipeline, ICommandLocator commandLocator) : base(commandPipeline, commandLocator) { }
public InMemoryCommandBus GetSut(ICommandPipeline pipeline) { var sut = new InMemoryCommandBus(pipeline); return(sut); }
public InMemoryCommandBus GetSut(ICommandPipeline pipeline) { var sut = new InMemoryCommandBus(pipeline, new NoopLoggerFactory()); return(sut); }