Пример #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);
        }