Beispiel #1
0
        public void UnDeleteProjectWithValidIdSucceeds()
        {
            var client = new TargetProcessClient {
                ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Projects)
            };
            // First, Create a project

            var data      = CreateCommonMethods.GetNewProject(client);
            var createdId = data.Data.Id;

            Assert.NotEqual(0, createdId);
            Assert.NotNull(createdId);

            // Then, Delete it
            var result = client.DeleteData <Project>((int)createdId);

            Assert.NotNull(result);
            Assert.NotNull(result.Data.Id);

            // Then undelete the project
            var undeleteClient = new TargetProcessClient {
                ApiSiteInfo = new ApiSiteInfo(TargetProcessRoutes.Route.Undelete)
            };
            var undeleteProjectData = undeleteClient.UndeleteProjectData((int)createdId);

            Assert.NotNull(undeleteProjectData);
            Assert.False(undeleteProjectData.HttpResponse.IsError);
        }