mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 00:46:39 +01:00
Removed OverlappedTop.
Updated unit tess. Fixed bad code paths.
This commit is contained in:
@@ -1103,7 +1103,7 @@ public class DialogTests
|
||||
_output
|
||||
);
|
||||
|
||||
Assert.True (Current.NewKeyDownEvent (Key.Enter));
|
||||
Assert.True (Top!.NewKeyDownEvent (Key.Enter));
|
||||
}
|
||||
else if (iterations == 3)
|
||||
{
|
||||
@@ -1199,104 +1199,85 @@ public class DialogTests
|
||||
d.Dispose ();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
public void Location_When_Not_Application_Top_Not_Default ()
|
||||
{
|
||||
var top = new Toplevel ();
|
||||
top.BorderStyle = LineStyle.Double;
|
||||
// [Fact]
|
||||
// [AutoInitShutdown]
|
||||
// public void Location_When_Not_Application_Top_Not_Default ()
|
||||
// {
|
||||
// var top = new Toplevel ();
|
||||
// top.BorderStyle = LineStyle.Double;
|
||||
|
||||
int iterations = -1;
|
||||
// int iterations = -1;
|
||||
|
||||
// Override CM
|
||||
Window.DefaultBorderStyle = LineStyle.Single;
|
||||
Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
// // Override CM
|
||||
// Window.DefaultBorderStyle = LineStyle.Single;
|
||||
// Dialog.DefaultButtonAlignment = Alignment.Center;
|
||||
// Dialog.DefaultBorderStyle = LineStyle.Single;
|
||||
// Dialog.DefaultShadow = ShadowStyle.None;
|
||||
|
||||
Iteration += (s, a) =>
|
||||
{
|
||||
iterations++;
|
||||
// Iteration += (s, a) =>
|
||||
// {
|
||||
// iterations++;
|
||||
|
||||
if (iterations == 0)
|
||||
{
|
||||
var d = new Dialog { X = 5, Y = 5, Height = 3, Width = 5 };
|
||||
RunState rs = Begin (d);
|
||||
// if (iterations == 0)
|
||||
// {
|
||||
// var d = new Dialog { X = 5, Y = 5, Height = 3, Width = 5 };
|
||||
// RunState rs = Begin (d);
|
||||
|
||||
Assert.Equal (new (5, 5), d.Frame.Location);
|
||||
// Assert.Equal (new (5, 5), d.Frame.Location);
|
||||
|
||||
TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
@"
|
||||
╔══════════════════╗
|
||||
║ ║
|
||||
║ ║
|
||||
║ ║
|
||||
║ ║
|
||||
║ ┌───┐ ║
|
||||
║ │ │ ║
|
||||
║ └───┘ ║
|
||||
║ ║
|
||||
╚══════════════════╝",
|
||||
_output
|
||||
);
|
||||
End (rs);
|
||||
d.Dispose ();
|
||||
// TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
// @"
|
||||
//╔══════════════════╗
|
||||
//║ ║
|
||||
//║ ║
|
||||
//║ ║
|
||||
//║ ║
|
||||
//║ ┌───┐ ║
|
||||
//║ │ │ ║
|
||||
//║ └───┘ ║
|
||||
//║ ║
|
||||
//╚══════════════════╝",
|
||||
// _output
|
||||
// );
|
||||
// End (rs);
|
||||
// d.Dispose ();
|
||||
|
||||
d = new ()
|
||||
{
|
||||
X = 5, Y = 5,
|
||||
Width = Dim.Percent (85),
|
||||
Height = Dim.Percent (85)
|
||||
// d = new ()
|
||||
// {
|
||||
// X = 5, Y = 5,
|
||||
// Width = Dim.Percent (85),
|
||||
// Height = Dim.Percent (85)
|
||||
|
||||
};
|
||||
rs = Begin (d);
|
||||
// };
|
||||
// rs = Begin (d);
|
||||
|
||||
// This is because of PostionTopLevels and EnsureVisibleBounds
|
||||
Assert.Equal (new (3, 2), d.Frame.Location);
|
||||
// TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
// @"
|
||||
//╔══════════════════╗
|
||||
//║ ║
|
||||
//║ ║
|
||||
//║ ║
|
||||
//║ ║
|
||||
//║ ┌──────────────
|
||||
//║ │
|
||||
//║ │
|
||||
//║ │
|
||||
//╚════│ ",
|
||||
// _output
|
||||
// );
|
||||
// End (rs);
|
||||
// d.Dispose ();
|
||||
// }
|
||||
// else if (iterations > 0)
|
||||
// {
|
||||
// RequestStop ();
|
||||
// }
|
||||
// };
|
||||
|
||||
// #3127: Before
|
||||
// Assert.Equal (new (17, 8), d.Frame.Size);
|
||||
// TestHelpers.AssertDriverContentsWithFrameAre (@"
|
||||
//╔══════════════════╗
|
||||
//║ ║
|
||||
//║ ┌───────────────┐
|
||||
//║ │ │
|
||||
//║ │ │
|
||||
//║ │ │
|
||||
//║ │ │
|
||||
//║ │ │
|
||||
//║ │ │
|
||||
//╚══└───────────────┘", _output);
|
||||
|
||||
// #3127: After: Because Toplevel is now Width/Height = Dim.Filll
|
||||
Assert.Equal (new (15, 6), d.Frame.Size);
|
||||
|
||||
TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
@"
|
||||
╔══════════════════╗
|
||||
║ ║
|
||||
║ ┌─────────────┐ ║
|
||||
║ │ │ ║
|
||||
║ │ │ ║
|
||||
║ │ │ ║
|
||||
║ │ │ ║
|
||||
║ └─────────────┘ ║
|
||||
║ ║
|
||||
╚══════════════════╝",
|
||||
_output
|
||||
);
|
||||
End (rs);
|
||||
d.Dispose ();
|
||||
}
|
||||
else if (iterations > 0)
|
||||
{
|
||||
RequestStop ();
|
||||
}
|
||||
};
|
||||
|
||||
((FakeDriver)Driver).SetBufferSize (20, 10);
|
||||
Run (top);
|
||||
top.Dispose ();
|
||||
}
|
||||
// ((FakeDriver)Driver).SetBufferSize (20, 10);
|
||||
// Run (top);
|
||||
// top.Dispose ();
|
||||
// }
|
||||
|
||||
[Fact]
|
||||
[AutoInitShutdown]
|
||||
|
||||
Reference in New Issue
Block a user