Exemple #1
0
        public void ProvisionProvisionsAndDeprovisionDeprovisions()
        {
            _cachedAppDirectApi.Authenticate(TestData.TestUsername2, TestData.TestPassword2);
            var originalMyApps = _cachedAppDirectApi.MyApps;

            var origAppsSet = new HashSet <Application>(originalMyApps);

            Assert.IsFalse(origAppsSet.Contains(new Application()
            {
                Id = TestData.TestFreeAppId
            }));

            var userInfo = _cachedAppDirectApi.UserInfo;
            var planId   = _cachedAppDirectApi.GetFreeSubscriptionPlanId(TestData.TestFreeAppId);

            var subscriptionId = _cachedAppDirectApi.ProvisionApplication(userInfo.UserId, userInfo.CompanyId, planId);

            Thread.Sleep(200);

            var myApps = _cachedAppDirectApi.MyApps;

            var appsSet = new HashSet <Application>(myApps);

            Assert.IsTrue(appsSet.Contains(new Application()
            {
                Id = TestData.TestFreeAppId
            }));

            Thread.Sleep(200);

            var result = _cachedAppDirectApi.DeprovisionApplication(subscriptionId);

            Assert.IsTrue(result);

            Thread.Sleep(200);

            var unsMyApps = _cachedAppDirectApi.MyApps;

            var unsAppsSet = new HashSet <Application>(unsMyApps);

            Assert.IsFalse(unsAppsSet.Contains(new Application()
            {
                Id = TestData.TestFreeAppId
            }));
        }
 public void ProvisionNullWhenNotAuthenticated()
 {
     Assert.IsNull(_cachedAppDirectApi.ProvisionApplication("1", "2", "3"));
 }