Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed May 1, 2021
1 parent a0a8068 commit b785165
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Build.UnitTests/BackEnd/NodePackets_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ private static TaskParameterEventArgs CreateTaskParameter()
items,
logItemMetadata: true,
DateTime.MinValue);
result.LineNumber = 30000;
result.ColumnNumber = 50;

// normalize line endings as we can't rely on the line endings of NodePackets_Tests.cs
Assert.Equal(@"Task Parameter:
Expand Down Expand Up @@ -433,6 +435,8 @@ private void CompareLogMessagePackets(LogMessagePacket left, LogMessagePacket ri
Assert.Equal(leftTaskParameter.Message, rightTaskParameter.Message);
Assert.Equal(leftTaskParameter.BuildEventContext, rightTaskParameter.BuildEventContext);
Assert.Equal(leftTaskParameter.Timestamp, rightTaskParameter.Timestamp);
Assert.Equal(leftTaskParameter.LineNumber, rightTaskParameter.LineNumber);
Assert.Equal(leftTaskParameter.ColumnNumber, rightTaskParameter.ColumnNumber);
break;

case LoggingEventType.TaskFinishedEvent:
Expand Down
4 changes: 4 additions & 0 deletions src/Build.UnitTests/BuildEventArgsSerialization_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,15 @@ public void RoundtripTaskParameterEventArgs()
new TaskItemData("ItemSpec2", Enumerable.Range(1,3).ToDictionary(i => i.ToString(), i => i.ToString() + "value"))
};
var args = new TaskParameterEventArgs(TaskParameterMessageKind.TaskOutput, "ItemName", items, true, DateTime.MinValue);
args.LineNumber = 265;
args.ColumnNumber = 6;

Roundtrip(args,
e => e.Kind.ToString(),
e => e.ItemType,
e => e.LogItemMetadata.ToString(),
e => e.LineNumber.ToString(),
e => e.ColumnNumber.ToString(),
e => TranslationHelpers.GetItemsString(e.Items));
}

Expand Down

0 comments on commit b785165

Please sign in to comment.