Пример #1
0
        public void CreateSubscription()
        {
            int      c1        = Client.GetSubscriptionsAsync().Result.Count;
            string   userId    = _userId;
            string   productId = _productId;
            string   name      = "server subscriptions";
            DateTime now       = DateTime.Now;
            SubscriptionDateSettings dateSettings = new SubscriptionDateSettings(now.AddDays(1), now.AddMonths(2));
            Subscription             subscription = Subscription.Create(userId, productId, name, dateSettings, SubscriptionState.active, subscriptionId: _subscriptionId);
            Subscription             entity       = Client.CreateSubscriptionAsync(subscription).Result;

            Assert.IsNotNull(entity);
            Assert.IsNotNull(entity.Id);
            int c2 = Client.GetSubscriptionsAsync().Result.Count;

            Assert.AreEqual(c1 + 1, c2);
        }
Пример #2
0
        public void CreateSubscription()
        {
            int      c1        = Client.GetSubscriptionsAsync().Result.Count;
            string   userId    = "user_bef163ba98af433c917914dd4c208115";
            string   productId = "5870184f9898000087060002";
            string   name      = "server subscriptions";
            DateTime now       = DateTime.Now;
            SubscriptionDateSettings dateSettings = new SubscriptionDateSettings(now.AddDays(1), now.AddMonths(2));
            Subscription             subscription = Subscription.Create(userId, productId, name, dateSettings, SubscriptionState.active);
            Subscription             entity       = Client.CreateSubscriptionAsync(subscription).Result;

            Assert.IsNotNull(entity);
            Assert.IsNotNull(entity.Id);
            int c2 = Client.GetSubscriptionsAsync().Result.Count;

            Assert.AreEqual(c1 + 1, c2);
        }