Added progress messages and quick access to exported files (#1112)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-25 22:10:38 +01:00
1 parent 7f72da628e
commit e0d8e18f34
33 files changed
+1130 -23

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
using AIStudio.Components;
namespace AIStudio.Tests.Components;
/// <summary>
/// Checks how the time below the progress bar of an assistant is written.
/// </summary>
/// <remarks>
/// Minutes and seconds suffice for almost every run; the hours come in front only once there are any,
/// and they keep counting past a day instead of starting over.
/// </remarks>
[TestFixture]
public sealed class ElapsedTimeTests
{
[TestCase(0, ExpectedResult = "0:00")]
[TestCase(9, ExpectedResult = "0:09")]
[TestCase(61, ExpectedResult = "1:01")]
[TestCase(59 * 60 + 59, ExpectedResult = "59:59")]
[TestCase(60 * 60, ExpectedResult = "1:00:00")]
[TestCase(25 * 60 * 60 + 3 * 60 + 4, ExpectedResult = "25:03:04")]
public string ATimeSpanIsWrittenAsMinutesAndSecondsWithHoursWhereThereAreAny(int seconds) => ElapsedTime.Format(TimeSpan.FromSeconds(seconds));
[Test]
public void ANegativeTimeSpanCountsAsNone() => Assert.That(ElapsedTime.Format(TimeSpan.FromSeconds(-5)), Is.EqualTo("0:00"), "A clock which was set back must not show a negative time.");
[Test]
public void FractionsOfASecondAreCutOff() => Assert.That(ElapsedTime.Format(TimeSpan.FromMilliseconds(1_999)), Is.EqualTo("0:01"));
}