Example #1
0
        public void WorkItemTracking_RecycleBin_RestoreMultipleItems_Success()
        {
            // arrange
            WorkItems  workItemsRequest  = new WorkItems(_configuration);
            RecycleBin recyclebinRequest = new RecycleBin(_configuration);

            WorkItemPatchResponse.WorkItem createResponse;
            string[] ids = new string[3];

            // act
            createResponse = workItemsRequest.CreateWorkItem(_configuration.Project);
            ids[0]         = createResponse.id.ToString();

            createResponse = workItemsRequest.CreateWorkItem(_configuration.Project);
            ids[1]         = createResponse.id.ToString();

            createResponse = workItemsRequest.CreateWorkItem(_configuration.Project);
            ids[2]         = createResponse.id.ToString();

            foreach (var id in ids)
            {
                var deleteResponse = workItemsRequest.DeleteWorkItem(id);
            }

            var respond = recyclebinRequest.RestoreMultipleItems(ids);

            //assert
            Assert.AreEqual(HttpStatusCode.OK, createResponse.HttpStatusCode);

            workItemsRequest  = null;
            recyclebinRequest = null;
        }