Skip to content

Commit

Permalink
Merge pull request #878 from solidify/bugfix/closed-date-for-reopened…
Browse files Browse the repository at this point in the history
…-bugs

Add fix for the ClosedDate field for reopened bugs
  • Loading branch information
Alexander-Hjelm authored Oct 9, 2023
2 parents 999d83b + 1b63833 commit 3eef434
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -668,11 +668,12 @@ private void CorrectClosedByAndClosedDate(WiRevision rev, WorkItem wi)
wiState.Equals("Done", StringComparison.InvariantCultureIgnoreCase)
|| wiState.Equals("Closed", StringComparison.InvariantCultureIgnoreCase)
)
&& revState.Equals("New", StringComparison.InvariantCultureIgnoreCase)
&& !(revState.Equals("Done", StringComparison.InvariantCultureIgnoreCase)
|| revState.Equals("Closed", StringComparison.InvariantCultureIgnoreCase))
)
{
rev.Fields.Add(new WiField() { ReferenceName = WiFieldReference.ClosedDate, Value = null });
rev.Fields.Add(new WiField() { ReferenceName = WiFieldReference.ClosedBy, Value = null });
rev.Fields.Add(new WiField() { ReferenceName = WiFieldReference.ClosedDate, Value = "" });
rev.Fields.Add(new WiField() { ReferenceName = WiFieldReference.ClosedBy, Value = "" });
}

if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ public void When_calling_ensure_fields_on_state_change_with_subsequent_revision_
Assert.Multiple(() =>
{
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.State), Is.EqualTo("New"));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedDate), Is.EqualTo(null));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedBy), Is.EqualTo(null));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedDate), Is.EqualTo(""));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedBy), Is.EqualTo(""));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ActivatedDate), Is.EqualTo(null));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ActivatedBy), Is.EqualTo(null));
});
Expand Down Expand Up @@ -365,8 +365,8 @@ public void When_calling_ensure_fields_on_a_closed_user_Story_with_Then_closed_d
Assert.Multiple(() =>
{
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.State), Is.EqualTo("New"));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedDate), Is.EqualTo(null));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedBy), Is.EqualTo(null));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedDate), Is.EqualTo(""));
Assert.That(rev.Fields.GetFieldValueOrDefault<string>(WiFieldReference.ClosedBy), Is.EqualTo(""));
});
}

Expand Down

0 comments on commit 3eef434

Please sign in to comment.