mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Refactored test namespaces. Moved some tests that were in wrong project. Code cleanup * Parrallel -> Parallel
72 lines
2.1 KiB
C#
72 lines
2.1 KiB
C#
using UnitTests;
|
|
|
|
namespace UnitTests.LayoutTests;
|
|
|
|
public class PosAnchorEndTests ()
|
|
{
|
|
// TODO: This actually a SetRelativeLayout/LayoutSubViews test and should be moved
|
|
// TODO: A new test that calls SetRelativeLayout directly is needed.
|
|
[Fact]
|
|
[AutoInitShutdown]
|
|
public void PosAnchorEnd_Equal_Inside_Window ()
|
|
{
|
|
var viewWidth = 10;
|
|
var viewHeight = 1;
|
|
|
|
var tv = new TextView
|
|
{
|
|
X = Pos.AnchorEnd (viewWidth), Y = Pos.AnchorEnd (viewHeight), Width = viewWidth, Height = viewHeight
|
|
};
|
|
|
|
var win = new Window ();
|
|
|
|
win.Add (tv);
|
|
|
|
Toplevel top = new ();
|
|
top.Add (win);
|
|
RunState rs = Application.Begin (top);
|
|
|
|
AutoInitShutdownAttribute.FakeResize (new Size (80,25));
|
|
|
|
Assert.Equal (new (0, 0, 80, 25), top.Frame);
|
|
Assert.Equal (new (0, 0, 80, 25), win.Frame);
|
|
Assert.Equal (new (68, 22, 10, 1), tv.Frame);
|
|
Application.End (rs);
|
|
top.Dispose ();
|
|
}
|
|
|
|
//// TODO: This actually a SetRelativeLayout/LayoutSubViews test and should be moved
|
|
//// TODO: A new test that calls SetRelativeLayout directly is needed.
|
|
//[Fact]
|
|
//[AutoInitShutdown]
|
|
//public void PosAnchorEnd_Equal_Inside_Window_With_MenuBar_And_StatusBar_On_Toplevel ()
|
|
//{
|
|
// var viewWidth = 10;
|
|
// var viewHeight = 1;
|
|
|
|
// var tv = new TextView
|
|
// {
|
|
// X = Pos.AnchorEnd (viewWidth), Y = Pos.AnchorEnd (viewHeight), Width = viewWidth, Height = viewHeight
|
|
// };
|
|
|
|
// var win = new Window ();
|
|
|
|
// win.Add (tv);
|
|
|
|
// var menu = new MenuBar ();
|
|
// var status = new StatusBar ();
|
|
// Toplevel top = new ();
|
|
// top.Add (win, menu, status);
|
|
// RunState rs = Application.Begin (top);
|
|
|
|
// Assert.Equal (new (0, 0, 80, 25), top.Frame);
|
|
// Assert.Equal (new (0, 0, 80, 1), menu.Frame);
|
|
// Assert.Equal (new (0, 24, 80, 1), status.Frame);
|
|
// Assert.Equal (new (0, 1, 80, 23), win.Frame);
|
|
// Assert.Equal (new (68, 20, 10, 1), tv.Frame);
|
|
|
|
// Application.End (rs);
|
|
// top.Dispose ();
|
|
//}
|
|
}
|