public async Task ReturnNotDeferredCommandResultForCommandWithNoResult() { HttpCommandDispatcher testSubject = new HttpCommandDispatcher(_commandExecuter.Object); CommandResult commandResult = await testSubject.DispatchAsync(new SimpleCommand(), default(CancellationToken)); Assert.False(commandResult.DeferExecution); }
public OfflineCommandDispatcher(HttpCommandDispatcher inner, ServerConnectionState serverConnection, CommandStorage storage) { Ensure.NotNull(inner, "inner"); Ensure.NotNull(serverConnection, "serverConnection"); Ensure.NotNull(storage, "expenseStorage"); this.inner = inner; this.serverConnection = serverConnection; this.storage = storage; }
public async Task ReturnNotDefferedCommandResultForCommandWithResult() { HttpCommandDispatcher testSubject = new HttpCommandDispatcher(_commandExecuter.Object); CommandResult <int> commandResult = await testSubject.DispatchAsync(new SimpleCommandWithIntegerResult(), default(CancellationToken)); Assert.False(commandResult.DeferExecution); Assert.Equal(default(int), commandResult.Result); }
/// <summary> /// Creates new instance that routes commands of type <typeparamref name="TCommand"/> to the <paramref name="route"/>. /// </summary> /// <param name="route">Route definition.</param> public HttpCommandHandler(RouteDefinition route) { this.dispatcher = new HttpCommandDispatcher(new DefaultRouteTable().Add(typeof(TCommand), route)); }
public void HaveAssociatedExecuter() { HttpCommandDispatcher testSubject = new HttpCommandDispatcher(_commandExecuter.Object); Assert.Equal(_commandExecuter.Object, testSubject.AssociatedExecuter); }