test: run process-wide tests serially and report constructor failures as themselves
Four App tests switched the process-wide UI language inside parallel classes, so another class's English assertion, or its constructor's reset to English, could land in the middle of them; they now live in the serial ArchiveLanguageTests and ImportLanguageTests. The App and Core test programs fail a test that leaves English outside a serial class at the switch, through the new TestContext.Current and TestContext.IsSerial. The FrameWindow cancellation test counted unobserved task exceptions while other classes ran beside it; it moves to the serial FrameWindowIsolationTests, and both unobserved-exception tests drain the finalizer queue before they start counting. The runner unwrapped TargetInvocationException only around the test method: a skip or an assertion thrown by a test class constructor or field initializer was reported as a failure reading "Exception has been thrown by the target of an invocation". Constructors are unwrapped the same way now. TestRunner.Discover(Type) and ExecuteAsync are public, so Tools.Tests checks the runner with nested fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
13 files changed
+381
-167
No files matched your search
@@ -11,7 +11,7 @@ public sealed class ImportPlansTests
|
||||
{
|
||||
public ImportPlansTests() => Loc.SetCulture(CultureInfo.GetCultureInfo("en"));
|
||||
|
||||
private static ImportPlan ThreeSessions(long? available = 200_000_000)
|
||||
internal static ImportPlan ThreeSessions(long? available = 200_000_000)
|
||||
{
|
||||
var duplicate = Guid.CreateVersion7();
|
||||
return Plan(available, [new ImportProblem("DCIM/100CANON/IMG_0099.CR2", "Access denied")],
|
||||
@@ -140,24 +140,6 @@ public sealed class ImportPlansTests
|
||||
Assert.Equal("Split at IMG_0002.CR2", file.SplitName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ARightToLeftLanguageReadsTheSessionTimesWithItsOwnArrow()
|
||||
{
|
||||
var plan = ThreeSessions();
|
||||
Assert.Contains("→", ImportPlans.Sessions(plan, ImportDestinationKind.Archive, new HashSet<string>())[0].TimeText);
|
||||
try
|
||||
{
|
||||
Loc.SetCulture(CultureInfo.GetCultureInfo("he"));
|
||||
var time = ImportPlans.Sessions(plan, ImportDestinationKind.Archive, new HashSet<string>())[0].TimeText;
|
||||
Assert.Contains("←", time);
|
||||
Assert.False(time.Contains('→'), "a right-to-left reader would see the arrow point back to the start");
|
||||
}
|
||||
finally
|
||||
{
|
||||
Loc.SetCulture(CultureInfo.GetCultureInfo("en"));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheNamePreviewShowsTheFirstThreeCopiedFiles()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user