public void RedmineTimeEntries_ShouldDelete() { var timeEntryId = "26"; try { redmineManager.DeleteObject <TimeEntry>(timeEntryId, null); } catch (RedmineException) { Assert.Fail("Time entry could not be deleted."); return; } try { TimeEntry timeEntry = redmineManager.GetObject <TimeEntry>(timeEntryId, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineIssues_ShouldDeleteIssue() { var issueId = "75"; try { redmineManager.DeleteObject <Issue>(issueId, null); } catch (RedmineException) { Assert.Fail("Issue could not be deleted."); return; } try { Issue issue = redmineManager.GetObject <Issue>(issueId, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineGroups_ShouldDeleteGroup() { var groupId = 16; try { redmineManager.DeleteObject <Group>(groupId.ToString(), null); } catch (RedmineException) { Assert.Fail("Group could not be deleted."); return; } try { Group group = redmineManager.GetObject <Group>(groupId.ToString(), null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineProjectMembership_ShouldDelete() { var pmId = "104"; try { redmineManager.DeleteObject <ProjectMembership>(pmId, null); } catch (RedmineException) { Assert.Fail("Project membership could not be deleted."); return; } try { ProjectMembership projectMembership = redmineManager.GetObject <ProjectMembership>(pmId, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineIssueRelation_ShouldDeleteRelation() { var relationId = "20"; try { redmineManager.DeleteObject <IssueRelation>(relationId, null); } catch (RedmineException) { Assert.Fail("Relation could not be deleted."); return; } try { IssueRelation issueRelation = redmineManager.GetObject <IssueRelation>(relationId, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineProjects_ShouldDeleteProject() { var projectId = "redmine-net-testxyz"; try { redmineManager.DeleteObject <Project>(projectId, null); } catch (RedmineException) { Assert.Fail("Project could not be deleted."); return; } try { Project project = redmineManager.GetObject <Project>(projectId, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineProjectVersion_ShouldDeleteVersion() { var versionId = "12"; try { redmineManager.DeleteObject <Redmine.Net.Api.Types.Version>(versionId, null); } catch (RedmineException) { Assert.Fail("Version could not be deleted."); return; } try { Redmine.Net.Api.Types.Version version = redmineManager.GetObject <Redmine.Net.Api.Types.Version>(versionId, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineUser_ShouldDeleteUser() { var id = 14; User user = null; try { user = redmineManager.GetObject <User>(id.ToString(), null); } catch (RedmineException) { Assert.Fail("User not found."); return; } if (user != null) { try { redmineManager.DeleteObject <User>(id.ToString(), null); } catch (RedmineException) { Assert.Fail("User could not be deleted."); return; } try { user = redmineManager.GetObject <User>(id.ToString(), null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } } Assert.Fail("Failed"); }
public void Should_Delete_User() { User user = null; try { user = redmineManager.GetObject <User>(USER_ID_TO_DELETE, null); } catch (RedmineException) { Assert.Fail("User not found."); return; } if (user != null) { try { redmineManager.DeleteObject <User>(USER_ID_TO_DELETE, null); } catch (RedmineException) { Assert.Fail("User could not be deleted."); return; } try { user = redmineManager.GetObject <User>(USER_ID_TO_DELETE, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } } Assert.Fail("Failed"); }
public void Should_Delete_Issue() { try { redmineManager.DeleteObject <Issue>(DELETED_ISSUE_ID, null); } catch (RedmineException) { Assert.Fail("Issue could not be deleted."); } try { redmineManager.GetObject <Issue>(DELETED_ISSUE_ID, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void Should_Delete_Project() { try { redmineManager.DeleteObject <Project>(DELETED_PROJECT_IDENTIFIER, null); } catch (RedmineException) { Assert.Fail("Project could not be deleted."); return; } try { Project project = redmineManager.GetObject <Project>(DELETED_PROJECT_IDENTIFIER, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void Should_Delete_IssueCategory() { try { redmineManager.DeleteObject <IssueCategory>(ISSUE_CATEGORY_ID_TO_DELETE, null); } catch (RedmineException) { Assert.Fail("Issue category could not be deleted."); return; } try { IssueCategory issueCategory = redmineManager.GetObject <IssueCategory>(ISSUE_CATEGORY_ID_TO_DELETE, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void Should_Delete_Group() { try { redmineManager.DeleteObject <Group>(DELETED_GROUP_ID, null); } catch (RedmineException) { Assert.Fail("Group could not be deleted."); return; } try { Group group = redmineManager.GetObject <Group>(DELETED_GROUP_ID, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void Should_Delete_Version() { try { redmineManager.DeleteObject <Redmine.Net.Api.Types.Version>(DELETED_VERSION_ID, null); } catch (RedmineException) { Assert.Fail("Version could not be deleted."); return; } try { Redmine.Net.Api.Types.Version version = redmineManager.GetObject <Redmine.Net.Api.Types.Version>(DELETED_VERSION_ID, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void Should_Delete_Issue_Relation() { try { redmineManager.DeleteObject <IssueRelation>(RELATION_ID_TO_DELETE, null); } catch (RedmineException) { Assert.Fail("Relation could not be deleted."); return; } try { IssueRelation issueRelation = redmineManager.GetObject <IssueRelation>(RELATION_ID_TO_DELETE, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void RedmineIssueCategory_ShouldDeleteIssueCategory() { try { redmineManager.DeleteObject <IssueCategory>(issueCategoryIdToDelete, null); } catch (RedmineException) { Assert.Fail("Issue category could not be deleted."); return; } try { IssueCategory issueCategory = redmineManager.GetObject <IssueCategory>(issueCategoryIdToDelete, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void Should_Delete_Time_Entry() { try { redmineManager.DeleteObject <TimeEntry>(DELETED_TIME_ENTRY_ID, null); } catch (RedmineException) { Assert.Fail("Time entry could not be deleted."); return; } try { TimeEntry timeEntry = redmineManager.GetObject <TimeEntry>(DELETED_TIME_ENTRY_ID, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
public void Should_Delete_Project_Membership() { try { redmineManager.DeleteObject <ProjectMembership>(DELETED_PROJECT_MEMBERSHIP_ID, null); } catch (RedmineException) { Assert.Fail("Project membership could not be deleted."); return; } try { ProjectMembership projectMembership = redmineManager.GetObject <ProjectMembership>(DELETED_PROJECT_MEMBERSHIP_ID, null); } catch (RedmineException exc) { StringAssert.Contains(exc.Message, "Not Found"); return; } Assert.Fail("Test failed"); }
/// <summary> /// Deletes the object asynchronous. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redmineManager">The redmine manager.</param> /// <param name="id">The identifier.</param> /// <returns></returns> public static Task DeleteObjectAsync <T>(this RedmineManager redmineManager, string id) where T : class, new() { return(Task.Factory.StartNew(() => redmineManager.DeleteObject <T>(id), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)); }
/// <summary> /// Deletes the object asynchronous. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redmineManager">The redmine manager.</param> /// <param name="id">The identifier.</param> /// <returns></returns> public static Task DeleteObjectAsync <T>(this RedmineManager redmineManager, string id) where T : class, new() { return(delegate { redmineManager.DeleteObject <T>(id); }); }
/// <summary> /// Deletes the object asynchronous. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redmineManager">The redmine manager.</param> /// <param name="id">The identifier.</param> /// <param name="parameters">The parameters.</param> /// <returns></returns> public static Task DeleteObjectAsync <T>(this RedmineManager redmineManager, string id, NameValueCollection parameters) where T : class, new() { return(Task.Factory.StartNew(() => redmineManager.DeleteObject <T>(id), TaskCreationOptions.LongRunning)); }
/// <summary> /// Deletes the object asynchronous. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="redmineManager">The redmine manager.</param> /// <param name="id">The identifier.</param> /// <param name="parameters">The parameters.</param> /// <returns></returns> public static Task DeleteObjectAsync <T>(this RedmineManager redmineManager, string id, NameValueCollection parameters) where T : class, new() { return(delegate { redmineManager.DeleteObject <T>(id); }); }