public RavenCommandStoreEmptyWhenSearchedAsyncTests() { helper = new RavenDbTestHelper(); helper.CreateFreshTestDatabase(); commandStore = new RavenDbCommandStore(new Raven.Client.Documents.DocumentStore() { Urls = RavenDbTestHelper.RavenDbSettings.NodeUrls, Database = RavenDbTestHelper.RavenDbSettings.TestDatabaseName }); _raisedCommand = new MyCommand { Value = "Value" }; }
public CommandProcessorUsingCommandStoreAsyncTests() { _commandStore = new InMemoryCommandStore(); var registry = new SubscriberRegistry(); registry.RegisterAsync <MyCommand, MyStoredCommandHandlerAsync>(); var container = new TinyIoCContainer(); var handlerFactory = new TinyIocHandlerFactoryAsync(container); container.Register <IHandleRequestsAsync <MyCommand>, MyStoredCommandHandlerAsync>(); container.Register(_commandStore); _command = new MyCommand { Value = "My Test String" }; _commandProcessor = new CommandProcessor(registry, handlerFactory, new InMemoryRequestContextFactory(), new PolicyRegistry()); }
public OnceOnlyAttributeWithThrowExceptionAsyncTests() { _commandStore = new InMemoryCommandStore(); var registry = new SubscriberRegistry(); registry.RegisterAsync <MyCommand, MyStoredCommandToThrowHandlerAsync>(); var container = new TinyIoCContainer(); var handlerFactory = new TinyIocHandlerFactoryAsync(container); container.Register <CommandSourcingHandlerAsync <MyCommand> >(); container.Register <IHandleRequestsAsync <MyCommand>, MyStoredCommandToThrowHandlerAsync>(); container.Register(_commandStore); _command = new MyCommand { Value = "My Test String" }; _commandProcessor = new CommandProcessor(registry, handlerFactory, new InMemoryRequestContextFactory(), new PolicyRegistry()); }
/// <summary> /// Initializes a new instance of the <see cref="CommandSourcingHandlerAsync{T}" /> class. /// </summary> /// <param name="commandStore">The store for commands that pass into the system</param> public CommandSourcingHandlerAsync(IAmACommandStoreAsync commandStore) { _commandStore = commandStore; }
/// <summary> /// Initializes a new instance of the <see cref="RequestHandlerAsyncCommandSourcingHandler{T}" /> class. /// </summary> /// <param name="commandStore">The store for commands that pass into the system</param> /// <param name="logger">The logger.</param> public RequestHandlerAsyncCommandSourcingHandler(IAmACommandStoreAsync commandStore, ILog logger) : base(logger) { _commandStore = commandStore; }
/// <summary> /// Initializes a new instance of the <see cref="RequestHandlerAsyncCommandSourcingHandler{T}" /> class. /// </summary> /// <param name="commandStore">The store for commands that pass into the system</param> public RequestHandlerAsyncCommandSourcingHandler(IAmACommandStoreAsync commandStore) : this(commandStore, LogProvider.GetCurrentClassLogger()) { }
/// <summary> /// Initializes a new instance of the <see cref="CommandSourcingHandlerAsync{T}" /> class. /// </summary> /// <param name="commandStore">The store for commands that pass into the system</param> public CommandSourcingHandlerAsync(IAmACommandStoreAsync commandStore) : this(commandStore, LogProvider.For <CommandSourcingHandlerAsync <T> >()) { }