Ejemplo n.º 1
0
        public void GetSubscriptionAction3()
        {
            Subscription        sub;
            Plan                newPlan;
            PayPalInterval      interval;
            Guid                userId;
            SubscriptionActions actions;

            sub      = new Subscription();
            sub.Plan = paidPlan;

            newPlan = paidPlan2;

            interval = new PayPalInterval(1, IntervalUnits.Years);

            userId = Guid.NewGuid();

            actions = PayPalManagement.GetSubscriptionAction(sub, newPlan, interval, userId);

            Assert.AreEqual(ActionTypes.Modify, actions.Action);
            Assert.AreEqual(199.99, actions.NewSubscription.Cost);
            Assert.AreEqual(null, actions.NewSubscription.EndTime);
            Assert.IsTrue(actions.NewSubscription.Id != Guid.Empty);
            Assert.AreEqual("1 Y", actions.NewSubscription.PayPalInterval);
            Assert.AreEqual(newPlan, actions.NewSubscription.Plan);
            Assert.AreEqual(userId, actions.NewSubscription.UserId);
        }
Ejemplo n.º 2
0
        public void GetSubscriptionAction()
        {
            Subscription        sub;
            Plan                newPlan;
            PayPalInterval      interval;
            Guid                userId;
            SubscriptionActions actions;

            sub      = new Subscription();
            sub.Plan = freePlan;

            newPlan = freePlan;

            interval = null;

            userId = Guid.NewGuid();

            actions = PayPalManagement.GetSubscriptionAction(sub, newPlan, interval, userId);
            Assert.AreEqual(ActionTypes.NoChange, actions.Action);
            Assert.AreEqual(null, actions.NewSubscription);
        }