app: fix the Resets section after the real-data check
On the developer's data the section counted the running instance as a reset, showed zeros before anything finished, and drew the skipped time of five early resets over almost the whole timeline (D12). The Resets tile now counts finished instances and names the running one. Unused, Gift and the median say when nothing finished or reset early. Skipped time is a thin hatched bar below the plot, one lane per overlap, and the axis no longer runs on to the running instance's reset. Percent and limit values follow the user's culture, and figures in captions do not wrap. The reset tooltip is tall. Where it could not fit above or below the pointer it slid over it, took the hover from the chart and vanished. Tall tooltips now open beside the pointer and use the width DataTooltip asks for. Refs #14
This commit is contained in:
@@ -82,10 +82,32 @@ public sealed class ResetHistoryTests
|
||||
Assert.Equal(1_000_000, early.Unused.Tokens); Assert.Equal(2m, early.Unused.ApiValue);
|
||||
Assert.Equal(3, history.Totals.Instances); Assert.Equal(2, history.Totals.Finished); Assert.Equal(1, history.Totals.Early);
|
||||
Assert.Equal(3_000_000, history.Totals.Tokens.Total); Assert.Equal(6m, history.Totals.ApiValue);
|
||||
Assert.Equal(110, history.Totals.Unused.Percent); Assert.Equal(TimeSpan.FromDays(2), history.MedianDuration);
|
||||
Assert.Equal(110, history.Totals.Unused.Percent); Assert.Equal(TimeSpan.FromDays(4.5), history.MedianDuration);
|
||||
Assert.Equal(TimeSpan.FromDays(5), history.Totals.Skipped);
|
||||
}
|
||||
|
||||
[Fact] public void RunningInstanceHasNoFinishedDurationOrResetValues()
|
||||
{
|
||||
var history = History(Window(Day), [], []);
|
||||
Assert.True(Assert.Single(history.Instances).Running);
|
||||
Assert.Equal(0, history.Totals.Finished); Assert.Equal(0, history.Totals.Early);
|
||||
Assert.Null(history.MedianDuration);
|
||||
Assert.Null(history.Instances[0].Unused); Assert.Null(history.Instances[0].Gift);
|
||||
Assert.All(history.EarlyByHour, count => Assert.Equal(0, count));
|
||||
Assert.All(history.EarlyByWeekday, count => Assert.Equal(0, count));
|
||||
}
|
||||
|
||||
[Fact] public void OnTimeFinishedInstancesHaveNoEarlyResetAndExcludeRunningDurationFromMedian()
|
||||
{
|
||||
var history = History(Window(Day + Week * 2), [Window(Day), Window(Day + Week)], []);
|
||||
Assert.Equal(2, history.Totals.Finished); Assert.Equal(0, history.Totals.Early);
|
||||
Assert.Equal(Week, history.MedianDuration);
|
||||
Assert.All(history.Instances.Where(r => !r.Running), row => Assert.NotNull(row.Unused));
|
||||
Assert.All(history.Instances, row => Assert.Null(row.Gift));
|
||||
Assert.All(history.EarlyByHour, count => Assert.Equal(0, count));
|
||||
Assert.All(history.EarlyByWeekday, count => Assert.Equal(0, count));
|
||||
}
|
||||
|
||||
[Fact] public void LowUseUsesMedianOfQualifyingListedInstances()
|
||||
{
|
||||
var first = Window(Day, 50); var second = Window(Day + Week, 25); var current = Window(Day + Week * 2, 4);
|
||||
|
||||
Reference in New Issue
Block a user