internal IssueRelation(RedmineServiceContext context, XmlNode node) : base(context, node) { _issue = RedmineUtility.LoadObject(node[IssueProperty.XmlNodeName], context.Issues.Lookup); _issueTo = RedmineUtility.LoadObject(node[IssueToProperty.XmlNodeName], context.Issues.Lookup); _type = RedmineUtility.LoadIssueRelationType(node[TypeProperty.XmlNodeName]); }
internal static IssueRelationType InvertRelationType(IssueRelationType issueRelationType) { switch (issueRelationType) { case IssueRelationType.precedes: return IssueRelationType.follows; case IssueRelationType.follows: return IssueRelationType.precedes; case IssueRelationType.duplicated: return IssueRelationType.duplicates; case IssueRelationType.duplicates: return IssueRelationType.duplicated; case IssueRelationType.blocks: return IssueRelationType.blocked; case IssueRelationType.blocked: return IssueRelationType.blocks; default: case IssueRelationType.relates: return issueRelationType; } }
public void Should_Add_Issue_Relation() { const IssueRelationType RELATION_TYPE = IssueRelationType.Follows; var relation = new IssueRelation { IssueToId = RELATED_ISSUE_ID, Type = RELATION_TYPE, Delay = RELATION_DELAY }; var savedRelation = fixture.RedmineManager.CreateObject(relation, ISSUE_ID); Assert.NotNull(savedRelation); Assert.True(savedRelation.IssueId == RELATED_ISSUE_ID, "Related issue id is not valid."); Assert.True(savedRelation.IssueToId.ToString().Equals(ISSUE_ID), "Issue id is not valid."); Assert.True(savedRelation.Delay == RELATION_DELAY, "Delay is not valid."); Assert.True(savedRelation.Type == OPPOSED_RELATION_TYPE, "Relation type is not valid."); }