Ejemplo n.º 1
0
 internal BoundedContext(CqrsEngine cqrsEngine, string name, int threadCount, long failedCommandRetryDelay, bool isLocal, string localBoundedContext)
 {
     ThreadCount             = threadCount;
     FailedCommandRetryDelay = failedCommandRetryDelay;
     IsLocal             = isLocal;
     LocalBoundedContext = localBoundedContext;
     Name              = name;
     EventsPublisher   = new EventsPublisher(cqrsEngine, this);
     CommandDispatcher = new CommandDispatcher(Name, threadCount, failedCommandRetryDelay);
     EventDispatcher   = new EventDispatcher(Name);
     Processes         = new List <IProcess>();
 }
Ejemplo n.º 2
0
        public EventsPublisherFixture()
        {
            ServiceBusSender = new FakeServiceBusSender();
            ServiceBusClient = new FakeServiceBusClient(ServiceBusSender);

            _preSendingSteps  = new List <IMessagePreSendingStep>();
            MessageSerializer = Mock.Of <IMessageSerializer>();
            Logger            = Mock.Of <ILogger <EventsPublisher> >();
            EventBusClient    = Mock.Of <IEventBusClient>();
            Mock.Get(EventBusClient)
            .Setup(s => s.Client)
            .Returns(ServiceBusClient);

            Publisher = new EventsPublisher(EventBusClient, MessageSerializer, Logger, PreSendingSteps);
        }