Esempio 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);
        }
Esempio 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;
     var data = new OldCacheUpdateRequest(CorrelationUri);
     Saga.RaiseEvent(LegacySubscriptionClientSaga.OldCacheUpdateRequested, data);
 }
Esempio 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;
            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);
        }