Ejemplo n.º 1
0
        public void BecauseOf()
        {
            var info    = new SubscriptionInformation(_clientId, 0, "", "", _dataUri);
            var message = new SubscriptionAdded {
                Subscription = info
            };

            var saga = new LegacySubscriptionClientSaga(_clientId);

            saga.Bus = new NullServiceBus();

            var data = new OldCacheUpdateRequest(_dataUri);

            saga.RaiseEvent(LegacySubscriptionClientSaga.OldCacheUpdateRequested, data);
            IEnumerable <LegacySubscriptionClientSaga> sagas = new List <LegacySubscriptionClientSaga>
            {
                saga
            };

            MockRepo.Stub(r => r.Where(s => s.CurrentState == LegacySubscriptionClientSaga.Active)).IgnoreArguments().Return(sagas);
            MockEndpointFactory.Expect(e => e.GetEndpoint(saga.Bus.Endpoint.Uri)).Return(saga.Bus.Endpoint);


            Service.Consume(message);
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     CorrelationUri = new Uri("msmq://bob/fitzgerald");
     CorrelationId = Guid.NewGuid();
     Saga = new LegacySubscriptionClientSaga(CorrelationId);
     MockBus = MockRepository.GenerateStub<IServiceBus>();
     MockBus.Stub(x => x.Endpoint).Return(new NullEndpoint());
     Saga.Bus = MockBus;
 }
Ejemplo n.º 3
0
 public void Setup()
 {
     CorrelationUri = new Uri("msmq://bob/fitzgerald");
     CorrelationId  = Guid.NewGuid();
     Saga           = new LegacySubscriptionClientSaga(CorrelationId);
     MockBus        = MockRepository.GenerateStub <IServiceBus>();
     MockBus.Stub(x => x.Endpoint).Return(new NullEndpoint());
     Saga.Bus = MockBus;
 }
Ejemplo n.º 4
0
 public void Setup()
 {
     CorrelationUri = new Uri("msmq://bob/fitzgerald");
     CorrelationId = Guid.NewGuid();
     Saga = new LegacySubscriptionClientSaga(CorrelationId);
     MockBus = MockRepository.GenerateStub<IServiceBus>();
     MockBus.Stub(x => x.Endpoint).Return(new NullEndpoint());
     Saga.Bus = MockBus;
     var data = new OldCacheUpdateRequest(CorrelationUri);
     Saga.RaiseEvent(LegacySubscriptionClientSaga.OldCacheUpdateRequested, data);
 }
Ejemplo n.º 5
0
        public void Setup()
        {
            CorrelationUri = new Uri("msmq://bob/fitzgerald");
            CorrelationId  = Guid.NewGuid();
            Saga           = new LegacySubscriptionClientSaga(CorrelationId);
            MockBus        = MockRepository.GenerateStub <IServiceBus>();
            MockBus.Stub(x => x.Endpoint).Return(new NullEndpoint());
            Saga.Bus = MockBus;
            var data = new OldCacheUpdateRequest(CorrelationUri);

            Saga.RaiseEvent(LegacySubscriptionClientSaga.OldCacheUpdateRequested, data);
        }
        public override void BecauseOf()
        {
            var info = new SubscriptionInformation(_clientId, 0, "", "", _dataUri);
            var message = new SubscriptionAdded {Subscription = info};

            var saga = new LegacySubscriptionClientSaga(_clientId);
            saga.Bus = new NullServiceBus();

            var data = new OldCacheUpdateRequest(_dataUri);

            saga.RaiseEvent(LegacySubscriptionClientSaga.OldCacheUpdateRequested, data);
            IEnumerable<LegacySubscriptionClientSaga> sagas = new List<LegacySubscriptionClientSaga>
                                                              {
                                                                  saga
                                                              };

            MockRepo.Stub(r => r.Where(s => s.CurrentState == LegacySubscriptionClientSaga.Active)).IgnoreArguments().Return(sagas);
            MockEndpointFactory.Expect(e => e.GetEndpoint(saga.Bus.Endpoint.Uri)).Return(saga.Bus.Endpoint);


            Service.Consume(message);
        }