diff --git a/sources/EncodingChecker.Tests/ConversionConfirmationFormTests.cs b/sources/EncodingChecker.Tests/ConversionConfirmationFormTests.cs index 0dde6ba..cfe13fb 100644 --- a/sources/EncodingChecker.Tests/ConversionConfirmationFormTests.cs +++ b/sources/EncodingChecker.Tests/ConversionConfirmationFormTests.cs @@ -4,11 +4,9 @@ namespace EncodingChecker.Tests; /// -/// The confirmation dialog is the only part of the safety model a GUI user ever reads, -/// and until now it was also the only part no test had ever executed. Layout code that -/// has never run is layout code that throws the first time somebody converts a directory -/// with an unusual mix of outcomes — and it would throw at exactly the moment the user is -/// being asked to approve something. +/// The confirmation dialog is the only part of the safety model a GUI user ever reads, and +/// it describes the outcomes at exactly the moment the user is asked to approve them. Layout +/// code that throws on an unusual mix of outcomes would fail there. /// /// These build it against real plans rather than asserting on pixels: every outcome mix, /// on an STA thread, checking that it constructs and that what it says matches the plan @@ -76,37 +74,109 @@ private static IEnumerable Descendants(Control root) private static string AllText(Control root) => string.Join("\n", Descendants(root).Select(c => c.Text)); + private static IEnumerable Named(Control root, string name) => + Descendants(root).Where(c => c.Name == name); + + // The count the dialog shows beside a category label, or null when the category is hidden. + private static string? CountShownFor(Control root, string label) + { + Label? cell = Descendants(root).OfType