Fix LogRecordTest by using InvariantCulture. (#1683)
* Fix LogRecordTest by using InvariantCulture. The test would fail if the current locale used something other than a dot as the decimal separator (e.g. comma). * dotnet-format
This commit is contained in:
parent
71290dc4d0
commit
3bb0445aa4
|
|
@ -21,6 +21,7 @@ using Microsoft.Extensions.DependencyInjection;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OpenTelemetry.Exporter;
|
||||
|
|
@ -213,7 +214,16 @@ namespace OpenTelemetry.Tests.Logs
|
|||
Assert.Contains(state, item => item.Key == "{OriginalFormat}");
|
||||
Assert.Equal("{food}", state.First(item => item.Key == "{OriginalFormat}").Value);
|
||||
|
||||
Assert.Equal("[Name, truffle], [Price, 299.99]", state.ToString());
|
||||
var prevCulture = CultureInfo.CurrentCulture;
|
||||
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
try
|
||||
{
|
||||
Assert.Equal("[Name, truffle], [Price, 299.99]", state.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
CultureInfo.CurrentCulture = prevCulture;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Reference in New Issue