Skip to content

Commit

Permalink
Fix dashboard formatting tests (#7526)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK authored Feb 11, 2025
1 parent bb03224 commit ad18db0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public void Render_NoInstrument_NoPlotlyInvocations()
}

[Fact]
[ActiveIssue("https://github.com/dotnet/aspire/issues/7433")]
public async Task Render_HasInstrument_InitializeChartInvocation()
{
// Arrange
Expand Down Expand Up @@ -107,7 +106,7 @@ public async Task Render_HasInstrument_InitializeChartInvocation()
Assert.Collection((IEnumerable<PlotlyTrace>)i.Arguments[1]!, trace =>
{
Assert.Equal("Unit-&lt;b&gt;Bold&lt;/b&gt;", trace.Name);
Assert.Equal("<b>Name-&lt;b&gt;Bold&lt;/b&gt;</b><br />Unit-&lt;b&gt;Bold&lt;/b&gt;: 1<br />Time: 12:59:57 AM", trace.Tooltips[0]);
Assert.Equal("<b>Name-&lt;b&gt;Bold&lt;/b&gt;</b><br />Unit-&lt;b&gt;Bold&lt;/b&gt;: 1<br />Time: 12:59:57 AM", trace.Tooltips[0], ignoreWhiteSpaceDifferences: true);
});
});
}
Expand Down
7 changes: 1 addition & 6 deletions tests/Aspire.Dashboard.Tests/FormatHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public class FormatHelpersTests
[InlineData("0.9", 0.9d)]
[InlineData("12,345,678.9", 12345678.9d)]
[InlineData("1.234568", 1.23456789d)]
[ActiveIssue("https://github.com/dotnet/aspire/issues/7433")]
public void FormatNumberWithOptionalDecimalPlaces_InvariantCulture(string expected, double value)
{
Assert.Equal(expected, FormatHelpers.FormatNumberWithOptionalDecimalPlaces(value, maxDecimalPlaces: 6, CultureInfo.InvariantCulture));
Expand All @@ -29,7 +28,6 @@ public void FormatNumberWithOptionalDecimalPlaces_InvariantCulture(string expect
[InlineData("0,9", 0.9d)]
[InlineData("12.345.678,9", 12345678.9d)]
[InlineData("1,234568", 1.23456789d)]
[ActiveIssue("https://github.com/dotnet/aspire/issues/7433")]
public void FormatNumberWithOptionalDecimalPlaces_GermanCulture(string expected, double value)
{
Assert.Equal(expected, FormatHelpers.FormatNumberWithOptionalDecimalPlaces(value, maxDecimalPlaces: 6, CultureInfo.GetCultureInfo("de-DE")));
Expand All @@ -41,7 +39,6 @@ public void FormatNumberWithOptionalDecimalPlaces_GermanCulture(string expected,
[InlineData("06/15/2009 13:45:30.1234567", MillisecondsDisplay.Full, "2009-06-15T13:45:30.1234567Z")]
[InlineData("06/15/2009 13:45:30", MillisecondsDisplay.None, "2009-06-15T13:45:30.0000000Z")]
[InlineData("06/15/2009 13:45:30", MillisecondsDisplay.None, "2009-06-15T13:45:30.1234567Z")]
[ActiveIssue("https://github.com/dotnet/aspire/issues/7433")]
public void FormatDateTime_WithMilliseconds_InvariantCulture(string expected, MillisecondsDisplay includeMilliseconds, string value)
{
var date = GetLocalDateTime(value);
Expand All @@ -66,7 +63,6 @@ public void FormatDateTime_WithMilliseconds_GermanCulture(string expected, Milli
[InlineData("15.6.2009 13.45.30,1234567", MillisecondsDisplay.Full, "2009-06-15T13:45:30.1234567Z")]
[InlineData("15.6.2009 13.45.30", MillisecondsDisplay.None, "2009-06-15T13:45:30.0000000Z")]
[InlineData("15.6.2009 13.45.30", MillisecondsDisplay.None, "2009-06-15T13:45:30.1234567Z")]
[ActiveIssue("https://github.com/dotnet/aspire/issues/7433")]
public void FormatDateTime_WithMilliseconds_FinnishCulture(string expected, MillisecondsDisplay includeMilliseconds, string value)
{
var date = GetLocalDateTime(value);
Expand All @@ -79,11 +75,10 @@ public void FormatDateTime_WithMilliseconds_FinnishCulture(string expected, Mill
[InlineData("15/06/2009 1:45:30.1234567 pm", MillisecondsDisplay.Full, "2009-06-15T13:45:30.1234567Z")]
[InlineData("15/06/2009 1:45:30 pm", MillisecondsDisplay.None, "2009-06-15T13:45:30.0000000Z")]
[InlineData("15/06/2009 1:45:30 pm", MillisecondsDisplay.None, "2009-06-15T13:45:30.1234567Z")]
[ActiveIssue("https://github.com/dotnet/aspire/issues/7433")]
public void FormatDateTime_WithMilliseconds_NewZealandCulture(string expected, MillisecondsDisplay includeMilliseconds, string value)
{
var date = GetLocalDateTime(value);
Assert.Equal(expected, FormatHelpers.FormatDateTime(CreateTimeProvider(), date, includeMilliseconds, cultureInfo: CultureInfo.GetCultureInfo("en-NZ")));
Assert.Equal(expected, FormatHelpers.FormatDateTime(CreateTimeProvider(), date, includeMilliseconds, cultureInfo: CultureInfo.GetCultureInfo("en-NZ")), ignoreWhiteSpaceDifferences: true);
}

private static DateTime GetLocalDateTime(string value)
Expand Down

0 comments on commit ad18db0

Please sign in to comment.