Exemplo n.º 1
0
            public InMemorySetFixture()
            {
                IdGenerator = Substitute.For <IIdGenerator>();
                IdGenerator.Identify(null).ReturnsForAnyArgs(c => c.Args()[0]);

                ObjectGraph = new ObjectGraph();

                MaterializationHooks = new List <IMaterializationHook>();

                Cache       = new Cache(IdGenerator, ObjectGraph, MaterializationHooks);
                InMemorySet = new InMemorySet(IdGenerator, Cache, ObjectGraph, MaterializationHooks);
            }
        public void DadoQueODespachanteTenhaSeInscrevidoParaReceberNotificacoesDeConclusaoDeProcessamentoParaUmaSolicitacaoDeTrabalhoDoTipoComIdentificador(string p0, string p1)
        {
            Settings = SettingsBuilder.Build();
            var inMemorySet = new InMemorySet();

            var subscriptionBusBuilder = new SubscriptionBusBuilder()
                .WithConnectionString(Settings.ConnectionString)
                //.WithImplementation(typeof(InMemorySingleProcessSubscriptionBus)).WithConstructorParameters(inMemorySet);
                .WithImplementation(typeof(EasyNetQSubscriptionBus));

            PublishingBusBuilder = new PublishingBusBuilder()
                .WithConnectionString(Settings.ConnectionString)
                //.WithImplementation(typeof(InMemorySingleProcessPublishingBus)).WithConstructorParameters(inMemorySet)
                .WithImplementation(typeof(EasyNetQPublishingBus))
                .WithPublishConfirms();

            var dispatcherLog = new DispatcherLog();
            WorkDispatcher = new Dispatcher(dispatcherLog, subscriptionBusBuilder, PublishingBusBuilder);

            Settings.RoutingTable[0].RequestMaxAttempts = 2;

            WorkDispatcher.LoadSettings(Settings);
            WorkDispatcher.Initialize();
        }
Exemplo n.º 3
0
            public InMemorySetFixture()
            {
                IdGenerator = Substitute.For<IIdGenerator>();
                IdGenerator.Identify(null).ReturnsForAnyArgs(c => c.Args()[0]);

                ObjectGraph = new ObjectGraph();

                MaterializationHooks = new List<IMaterializationHook>();

                Cache = new Cache(IdGenerator, ObjectGraph, MaterializationHooks);
                InMemorySet = new InMemorySet(IdGenerator, Cache, ObjectGraph, MaterializationHooks);
            }