public void Nothing()
        {
            var repo = A.Fake <IDomainObjectRepository>();

            ConventionCommandInvoker sut = GetSut(repo);

            Type type = typeof(FakeObject);
            var  cmd  = new SampleCommand();
        }
예제 #2
0
        public static InMemoryCommandBus CreateConventionCommandBus(IDomainObjectRepository repository,
                                                                    params Assembly[] domainObjectAssemblies)
        {
            Precondition.For(repository, nameof(repository)).NotNull();

            var invoker = new ConventionCommandInvoker(repository);
            var handler = new ConventionCommandPipeline(invoker, new DomainObjectLocator(), domainObjectAssemblies);
            var bus     = new InMemoryCommandBus(handler);

            return(bus);
        }
예제 #3
0
        public void ItThrowsAtEndOfRetries()
        {
            var repo = A.Fake <IDomainObjectRepository>();

            A.CallTo(() => repo.SaveAsync(A <IDomainObject> .Ignored, A <bool> .Ignored))
            .Returns(AppendResult.WrongVersion(2));

            ConventionCommandInvoker sut = GetSut(repo);

            var cmd = new SampleCommand();
        }
예제 #4
0
        public static InMemoryCommandBus CreateConventionCommandBus(IDomainObjectRepository repository,
                                                                    ILoggerFactory loggerFactory,
                                                                    EventSourceConfiguration configuration)
        {
            Precondition.For(repository, nameof(repository)).NotNull();
            Precondition.For(loggerFactory, nameof(loggerFactory)).NotNull();
            Precondition.For(configuration, nameof(configuration)).NotNull();

            var logger = loggerFactory.CreateLogger <InMemoryCommandBus>();

            logger.LogInformation("Building InMemory CommandBus with convention based pipeline");

            var invoker = new ConventionCommandInvoker(repository, loggerFactory);
            var handler = new ConventionCommandPipeline(invoker, new DomainObjectLocator(), loggerFactory,
                                                        configuration.DomainObjectAssemblies);

            var bus = new InMemoryCommandBus(handler, loggerFactory);

            return(bus);
        }
        protected ConventionCommandInvoker GetSut(IDomainObjectRepository repo)
        {
            var sut = new ConventionCommandInvoker(repo, new NoopLoggerFactory());

            return(sut);
        }