public void FixtureSetup()
        {
            SubscriptionServiceMock = MockRepository.GenerateStub<ISubscriptionServicePortTypeClient>();
            Client = new SoapSubscriptionClient(SubscriptionServiceMock);

            SubscriptionId = 1;
            SubscriptionFilter = new CfSubscriptionSubscriptionFilter(1, 5, "fromNumber", "toNumber", true);
            Subscription = new CfSubscription(SubscriptionId, true, "endPoint", CfNotificationFormat.Soap, CfSubscriptionTriggerEvent.CampaignStarted, SubscriptionFilter);
            SubscriptionRequest = new CfSubscriptionRequest("requestId", Subscription);

            var notificationFormat = EnumeratedMapper.ToSoapEnumerated<NotificationFormat>(Subscription.NotificationFormat.ToString());
            var triggerEvent = EnumeratedMapper.ToSoapEnumerated<SubscriptionTriggerEvent>(Subscription.TriggerEvent.ToString());
            SubscriptionServiceMock.Stub(b => b.CreateSubscription(
                Arg<SubscriptionRequest>.Matches(x => x.RequestId == SubscriptionRequest.RequestId &&
                                                      x.Subscription.id == Subscription.Id &&
                                                      x.Subscription.Enabled == Subscription.Enabled &&
                                                      x.Subscription.Endpoint == Subscription.Endpoint &&
                                                      x.Subscription.NotificationFormat == notificationFormat &&
                                                      x.Subscription.TriggerEvent == triggerEvent &&
                                                      x.Subscription.SubscriptionFilter.BroadcastId == SubscriptionFilter.BroadcastId &&
                                                      x.Subscription.SubscriptionFilter.BatchId == SubscriptionFilter.BatchId &&
                                                      x.Subscription.SubscriptionFilter.FromNumber == SubscriptionFilter.FromNumber &&
                                                      x.Subscription.SubscriptionFilter.ToNumber == SubscriptionFilter.ToNumber &&
                                                      x.Subscription.SubscriptionFilter.Inbound == SubscriptionFilter.Inbound)))
                .Return(SubscriptionId);
        }
        public void FixtureSetup()
        {
            SubscriptionServiceMock = MockRepository.GenerateStub<ISubscriptionServicePortTypeClient>();
            Client = new SoapSubscriptionClient(SubscriptionServiceMock);

            SubscriptionId = 1;

            SubscriptionServiceMock.Stub(b => b.DeleteSubscription(Arg<IdRequest>.Matches(x => x.Id == SubscriptionId)));
        }
        public void FixtureSetup()
        {
            SubscriptionServiceMock = MockRepository.GenerateStub<ISubscriptionServicePortTypeClient>();
            Client = new SoapSubscriptionClient(SubscriptionServiceMock);

            SubscriptionFilter = new CfSubscriptionSubscriptionFilter(1, 5, "fromNumber", "toNumber", true);
            Subscription = new CfSubscription(1, true, "endPoint", CfNotificationFormat.Soap,
                CfSubscriptionTriggerEvent.CampaignStarted, SubscriptionFilter);
            GenerateMock(Subscription, 1);

            var subscription = new CfSubscription(2, true, "endPoint", CfNotificationFormat.Soap,
                CfSubscriptionTriggerEvent.CampaignStarted, null);
            GenerateMock(subscription, 2);
        }
        public void FixtureSetup()
        {
            Client = new SoapSubscriptionClient(MockClient.User(), MockClient.Password());

            var subscriptionFilter = new CfSubscriptionSubscriptionFilter(1, 5, "fromNumber", "toNumber", true);
            CfSubscription = new CfSubscription(1, true, "endPoint", CfNotificationFormat.Soap, 
                CfSubscriptionTriggerEvent.UndefinedEvent, subscriptionFilter);
            CfSubscriptionRequest = new CfSubscriptionRequest("", CfSubscription);

            QuerySubscription = new CfQuery();

            var subscription = new CfSubscription(140553001, true, "endPoint", CfNotificationFormat.Soap, 
                CfSubscriptionTriggerEvent.CampaignStarted, subscriptionFilter);
            CfUpdateSubscription = new CfSubscriptionRequest("", subscription);
        }
        public void FixtureSetup()
        {
            SubscriptionServiceMock = MockRepository.GenerateStub<ISubscriptionServicePortTypeClient>();
            Client = new SoapSubscriptionClient(SubscriptionServiceMock);

            Query = new CfQuery(100, 0);

            SubscriptionFilter = new CfSubscriptionSubscriptionFilter(1, 5, "fromNumber", "toNumber", true);
            Subscription = new CfSubscription(1, true, "endPoint", CfNotificationFormat.Soap,
                CfSubscriptionTriggerEvent.CampaignStarted, SubscriptionFilter);

            var subscriptions = new CfSubscription[1];
            subscriptions[0] = Subscription;
            SubscriptionQueryResult = new CfSubscriptionQueryResult(1, subscriptions);

            GenerateMock(SubscriptionQueryResult, Query);

            subscriptions[0] = null;
            var subscriptionQueryResult = new CfSubscriptionQueryResult(1, subscriptions);
            var query = new CfQuery(100, 1);
            GenerateMock(subscriptionQueryResult, query);
        }