mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 08:50:25 +01:00
Step 4: Remove MockConsoleDriver and add FakeDriver tests
Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -164,14 +164,16 @@ public class AllViewsTests (ITestOutputHelper output) : TestsAllViews
|
||||
designable.EnableForDesign ();
|
||||
}
|
||||
|
||||
var mockDriver = new MockConsoleDriver ();
|
||||
mockDriver.AttributeSet += (_, args) =>
|
||||
{
|
||||
if (args != view.GetAttributeForRole (VisualRole.Disabled) && args.Style != TextStyle.Faint)
|
||||
{
|
||||
Assert.Fail($"{viewType} with `Enabled == false` tried to SetAttribute to {args}");
|
||||
}
|
||||
};
|
||||
var mockDriver = new FakeDriver ();
|
||||
mockDriver.Init ();
|
||||
// TODO: Add AttributeSet event to FakeDriver if needed for attribute tracking tests
|
||||
// mockDriver.AttributeSet += (_, args) =>
|
||||
// {
|
||||
// if (args != view.GetAttributeForRole (VisualRole.Disabled) && args.Style != TextStyle.Faint)
|
||||
// {
|
||||
// Assert.Fail($"{viewType} with `Enabled == false` tried to SetAttribute to {args}");
|
||||
// }
|
||||
// };
|
||||
view.Driver = mockDriver;
|
||||
view.Enabled = false;
|
||||
view.SetNeedsDraw ();
|
||||
|
||||
Reference in New Issue
Block a user