10 references to DurationFormatter
Aspire.Dashboard.Tests (10)
DurationFormatterTests.cs (10)
23Assert.Equal(unit, DurationFormatter.GetUnit(TimeSpan.FromTicks(ticks))); 29Assert.Equal("1μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(1 * TimeSpan.TicksPerMicrosecond))); 36Assert.Equal("10d 14h", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 43Assert.Equal("2d", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 50Assert.Equal(2.36m.ToString("0.##ms", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 57Assert.Equal(2.36m.ToString("0.##s", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 64Assert.Equal("2m 31s", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 71Assert.Equal("2h 31m", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input))); 78Assert.Equal(0.1m.ToString("0.##μs", CultureInfo.CurrentCulture), DurationFormatter.FormatDuration(TimeSpan.FromTicks((long)input))); 85Assert.Equal("0μs", DurationFormatter.FormatDuration(TimeSpan.FromTicks(input)));