Пример #1
0
        public static void ClassCleanup()
        {
            //Delete ALL Images
            //Delete Image List
            //Call get all lists to verify deletion

            var imageListclient = new ListManagementClient(ConfigurationManager.AppSettings["subscriptionkey"]);

            var updateImageList = imageListclient.ImageListUpdateAsync(listId, "Updated Name", "Updated", null).Result;

            Assert.IsNotNull(updateImageList);

            var deleteAllRes = imageListclient.ImageDeleteAllAsync(listId).Result;

            Assert.IsNotNull(deleteAllRes);

            var deleteImageList = imageListclient.ImageListDeleteAsync(listId).Result;

            Assert.IsNotNull(deleteImageList);


            var getAllRes = imageListclient.ImageListGetAllAsync().Result;

            Assert.IsNotNull(getAllRes);
            Assert.IsTrue(!getAllRes.Exists(e => e.Id == listId));
        }
Пример #2
0
        public static void ClassInitialize(TestContext testContext)
        {
            //Create a new list
            //Get all Lists to verify creation

            var imageListclient = new ListManagementClient(ConfigurationManager.AppSettings["subscriptionkey"]);
            var listName        = Guid.NewGuid().ToString("n");

            Dictionary <string, string> listMetaData = new Dictionary <string, string>();

            listMetaData.Add("MyListMData1", "MyListMData1");
            listMetaData.Add("MyListMData2", "MyListMData2");

            var createRes = imageListclient.ImageListCreateAsync(listName, "This is Unit Test", listMetaData).Result;

            Assert.IsNotNull(createRes);
            Assert.IsTrue(!string.IsNullOrWhiteSpace(createRes.Id));

            listId = createRes.Id;

            var getAllRes = imageListclient.ImageListGetAllAsync().Result;

            Assert.IsNotNull(getAllRes);
            Assert.IsTrue(getAllRes.Count > 0);
            Assert.IsTrue(getAllRes.Exists(e => e.Id == createRes.Id));

            Dictionary <string, string[]> x = new Dictionary <string, string[]>();
        }