예제 #1
0
        public void CL_WorkItemTracking_RecycleBin_RestoreItem_Success()
        {
            // arrange
            RecycleBin recycleBin = new RecycleBin(_configuration);
            WorkItems  workItems  = new WorkItems(_configuration);

            // act
            ////create workitem, delete it, restore it, get it
            var item = workItems.CreateWorkItem(_configuration.Project);

            workItems.DeleteWorkItem(Convert.ToInt32(item.Id));

            var restoreResult = recycleBin.RestoreItem(Convert.ToInt32(item.Id));
            var getResult     = workItems.GetWorkItem(Convert.ToInt32(item.Id));

            //assert
            Assert.IsNotNull(getResult);
            Assert.AreEqual(getResult.Id, item.Id);
        }
예제 #2
0
        public void WorkItemTracking_RecycleBin_RestoreItem_Success()
        {
            // arrange
            WorkItems  workItemsRequest  = new WorkItems(_configuration);
            RecycleBin recyclebinRequest = new RecycleBin(_configuration);

            // act
            WorkItemPatchResponse.WorkItem       createResponse  = workItemsRequest.CreateWorkItem(_configuration.Project);
            WorkItemPatchResponse.WorkItem       deleteResponse  = workItemsRequest.DeleteWorkItem(createResponse.id.ToString());
            GetRestoredWorkItemResponse.WorkItem restoreResponse = recyclebinRequest.RestoreItem(createResponse.id.ToString());

            ////get restored item
            GetWorkItemExpandAllResponse.WorkItem getRestoredItemResponse = workItemsRequest.GetWorkItem(createResponse.id.ToString());

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

            workItemsRequest  = null;
            recyclebinRequest = null;
        }