コード例 #1
0
        public void Delete()
        {
            string tag = GetRandomString();
            string url = PostTests.AddTestPost(tag);

            Assert.IsTrue(url.Length > 0, "The url '" + url + "' was not sucessfully added.");

            string bundleName = AddTestBundle(tag);

            Bundle.Delete(bundleName);
            CleanupBundleList.Remove(bundleName);
            bool found = false;

            // it regularly take a couple of seconds for the deleted bundle to show as deleted through the api
            System.Threading.Thread.Sleep(2000);
            List <Bundle> bundles = Bundle.Get();

            foreach (Bundle b in bundles)
            {
                if (b.Name == bundleName)
                {
                    found = true;
                    break;
                }
            }
            Assert.IsTrue(!found, "The Bundle '" + bundleName + "' was not sucessfully deleted");
        }
コード例 #2
0
        internal static string AddTestBundle(string tags)
        {
            string bundleName = GetRandomString();
            bool   added      = Bundle.Add(bundleName, tags);

            CleanupBundleList.Add(bundleName);
            Assert.IsTrue(added, "The Bundle '" + bundleName + "' was not sucessfully added.");

            return(bundleName);
        }