Skip to content

Commit

Permalink
Merge branch 'test/unit-test-fix' into feature/sockets-http-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr committed Jan 7, 2025
2 parents 3545d9c + 8a24572 commit f128c87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public DateTime Timestamp
return _timestamp = _newRelicPayload.Timestamp;
}

return _timestamp = (DateTime)default; // default is same as new.
return _timestamp = default(DateTime); // default is same as new.
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void AcceptDistributedTraceHeadersHydratesValidNewRelicPayload(string hea
Assert.That(tracingState.Priority, Is.EqualTo(Priority));
Assert.That(tracingState.Sampled, Is.EqualTo(Sampled));
Assert.That(tracingState.TransactionId, Is.EqualTo(TransactionId));
Assert.That(tracingState.Timestamp, Is.Not.EqualTo(default), $"Timestamp should not be {(DateTime)default}");
Assert.That(tracingState.Timestamp, Is.Not.EqualTo(default(DateTime)), $"Timestamp should not be {default(DateTime)}");
Assert.That(tracingState.TransportDuration, Is.GreaterThan(TimeSpan.Zero), $"TransportDuration should not be Zero");
});
}
Expand Down Expand Up @@ -92,7 +92,7 @@ public void AcceptDistributedTraceHeadersPopulatesErrorsIfNull(string headerName
Assert.That(tracingState.TransactionId, Is.Null);
Assert.That(tracingState.Sampled, Is.Null);
Assert.That(tracingState.Priority, Is.Null);
Assert.That(tracingState.Timestamp, Is.EqualTo((DateTime)default), $"Timestamp: expected {(DateTime)default}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.Timestamp, Is.EqualTo(default(DateTime)), $"Timestamp: expected {default(DateTime)}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.TransportDuration, Is.EqualTo(TimeSpan.Zero), $"TransportDuration: expected {TimeSpan.Zero}, actual: {tracingState.TransportDuration}");

Assert.That(tracingState.IngestErrors, Does.Contain(IngestErrorType.NullPayload), "TracingState IngestErrors should contain NullPayload");
Expand Down Expand Up @@ -124,7 +124,7 @@ public void AcceptDistributedTraceHeadersPopulatesErrorsIfUnsupportedVersion(str
Assert.That(tracingState.TransactionId, Is.Null);
Assert.That(tracingState.Sampled, Is.Null);
Assert.That(tracingState.Priority, Is.Null);
Assert.That(tracingState.Timestamp, Is.EqualTo((DateTime)default), $"Timestamp: expected {(DateTime)default}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.Timestamp, Is.EqualTo(default(DateTime)), $"Timestamp: expected {default(DateTime)}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.TransportDuration, Is.EqualTo(TimeSpan.Zero), $"TransportDuration: expected {TimeSpan.Zero}, actual: {tracingState.TransportDuration}");

Assert.That(tracingState.IngestErrors, Does.Contain(IngestErrorType.Version), "TracingState IngestErrors should contain Version error.");
Expand Down Expand Up @@ -156,7 +156,7 @@ public void AcceptDistributedTraceHeadersPopulatesErrorsIfInvalidTimestamp(strin
Assert.That(tracingState.TransactionId, Is.Null);
Assert.That(tracingState.Sampled, Is.Null);
Assert.That(tracingState.Priority, Is.Null);
Assert.That(tracingState.Timestamp, Is.EqualTo((DateTime)default), $"Timestamp: expected {(DateTime)default}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.Timestamp, Is.EqualTo(default(DateTime)), $"Timestamp: expected {default(DateTime)}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.TransportDuration, Is.EqualTo(TimeSpan.Zero), $"TransportDuration: expected {TimeSpan.Zero}, actual: {tracingState.TransportDuration}");

Assert.That(tracingState.IngestErrors, Does.Contain(IngestErrorType.ParseException), "TracingState IngestErrors should contain ParseException.");
Expand Down Expand Up @@ -188,7 +188,7 @@ public void AcceptDistributedTraceHeadersPopulatesErrorsIfNotTraceable(string he
Assert.That(tracingState.TransactionId, Is.Null);
Assert.That(tracingState.Sampled, Is.Null);
Assert.That(tracingState.Priority, Is.Null);
Assert.That(tracingState.Timestamp, Is.EqualTo((DateTime)default), $"Timestamp: expected {(DateTime)default}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.Timestamp, Is.EqualTo(default(DateTime)), $"Timestamp: expected {default(DateTime)}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.TransportDuration, Is.EqualTo(TimeSpan.Zero), $"TransportDuration: expected {TimeSpan.Zero}, actual: {tracingState.TransportDuration}");

Assert.That(tracingState.IngestErrors, Does.Contain(IngestErrorType.ParseException), "TracingState IngestErrors should contain ParseException.");
Expand Down Expand Up @@ -222,7 +222,7 @@ public void AcceptDistributedTraceHeadersHydratesValidW3CTraceContext()
Assert.That(tracingState.Sampled, Is.EqualTo(Sampled));
Assert.That(tracingState.TransactionId, Is.EqualTo(TransactionId));
Assert.That(tracingState.ParentId, Is.EqualTo(ParentId));
Assert.That(tracingState.Timestamp, Is.Not.EqualTo(default), $"Timestamp should not be {(DateTime)default}");
Assert.That(tracingState.Timestamp, Is.Not.EqualTo(default(DateTime)), $"Timestamp should not be {default(DateTime)}");
Assert.That(tracingState.TransportDuration, Is.GreaterThan(TimeSpan.Zero), $"TransportDuration should not be Zero");
});
}
Expand Down Expand Up @@ -251,7 +251,7 @@ public void AcceptDistributedTraceHeadersHydratesValidW3CTraceContext_WithoutAVa
Assert.That(tracingState.TraceId, Is.EqualTo(TraceId));
Assert.That(tracingState.ParentId, Is.EqualTo(ParentId));
Assert.That(tracingState.Type, Is.EqualTo(DistributedTracingParentType.Unknown));
Assert.That(tracingState.Timestamp, Is.EqualTo((DateTime)default), $"Timestamp: expected {(DateTime)default}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.Timestamp, Is.EqualTo(default(DateTime)), $"Timestamp: expected {default(DateTime)}, actual: {tracingState.Timestamp}");
Assert.That(tracingState.TransportDuration, Is.EqualTo(TimeSpan.Zero), $"TransportDuration: expected {TimeSpan.Zero}, actual: {tracingState.TransportDuration}");
});
}
Expand Down

0 comments on commit f128c87

Please sign in to comment.