mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 15:02:15 +01:00
fix: Sonar's remarks on the screen reader work, and tests for it
The cab panel's drawing and the consist narration are split into smaller steps, with plain switches and concrete return types where Sonar asked. Tests drive the black box panels, both tape views, the key bindings, the windows opened over another, the search count and the themed tree entries, sliders, number boxes, pickers and settings sections headless, as someone at the keyboard with a screen reader meets them.
This commit is contained in:
@@ -2,6 +2,7 @@ using Avalonia.Automation;
|
||||
using Avalonia.Automation.Peers;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.VisualTree;
|
||||
using StarterNG.Controls;
|
||||
|
||||
namespace StarterNG.Tests;
|
||||
@@ -49,7 +50,12 @@ public class AnnouncerTests
|
||||
[Fact]
|
||||
public void A_control_outside_any_announcer_is_not_heard()
|
||||
{
|
||||
Announcer.Say(new Button(), "Godzina: 07:05");
|
||||
var button = new Button();
|
||||
|
||||
var thrown = Record.Exception(() => Announcer.Say(button, "Godzina: 07:05"));
|
||||
|
||||
Assert.Null(thrown);
|
||||
Assert.Null(button.FindAncestorOfType<Announcer>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user