mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Rename Rect to Rectangle in preparation for removal
This commit is contained in:
@@ -154,7 +154,7 @@ public class CheckBoxTests
|
||||
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
|
||||
|
||||
Assert.True (checkBox.IsInitialized);
|
||||
Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 19, 1), checkBox.Frame);
|
||||
Assert.Equal ("Check this out 你", checkBox.Text);
|
||||
Assert.Equal ($"{CM.Glyphs.UnChecked} Check this out 你", checkBox.TextFormatter.Text);
|
||||
Assert.True (checkBox.AutoSize);
|
||||
@@ -171,7 +171,7 @@ public class CheckBoxTests
|
||||
Application.RunIteration (ref runstate, ref firstIteration);
|
||||
|
||||
// BUGBUG - v2 - Autosize is busted; disabling tests for now
|
||||
Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 19, 1), checkBox.Frame);
|
||||
|
||||
var expected = @"
|
||||
┌┤Test Demo 你├──────────────┐
|
||||
@@ -180,8 +180,8 @@ public class CheckBoxTests
|
||||
│ │
|
||||
└────────────────────────────┘";
|
||||
|
||||
Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
|
||||
checkBox.Width = 19;
|
||||
|
||||
@@ -189,7 +189,7 @@ public class CheckBoxTests
|
||||
checkBox.Text = "Check this out 你 changed";
|
||||
Application.RunIteration (ref runstate, ref firstIteration);
|
||||
Assert.False (checkBox.AutoSize);
|
||||
Assert.Equal (new Rect (1, 1, 19, 1), checkBox.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 19, 1), checkBox.Frame);
|
||||
|
||||
expected = @"
|
||||
┌┤Test Demo 你├──────────────┐
|
||||
@@ -199,11 +199,11 @@ public class CheckBoxTests
|
||||
└────────────────────────────┘";
|
||||
|
||||
pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
|
||||
checkBox.AutoSize = true;
|
||||
Application.RunIteration (ref runstate, ref firstIteration);
|
||||
Assert.Equal (new Rect (1, 1, 27, 1), checkBox.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 27, 1), checkBox.Frame);
|
||||
|
||||
expected = @"
|
||||
┌┤Test Demo 你├──────────────┐
|
||||
@@ -213,7 +213,7 @@ public class CheckBoxTests
|
||||
└────────────────────────────┘";
|
||||
|
||||
pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -226,7 +226,7 @@ public class CheckBoxTests
|
||||
Assert.Equal (string.Empty, ckb.Text);
|
||||
Assert.Equal ($"{CM.Glyphs.UnChecked} ", ckb.TextFormatter.Text);
|
||||
Assert.True (ckb.CanFocus);
|
||||
Assert.Equal (new Rect (0, 0, 2, 1), ckb.Frame);
|
||||
Assert.Equal (new Rectangle (0, 0, 2, 1), ckb.Frame);
|
||||
|
||||
ckb = new CheckBox { Text = "Test", Checked = true };
|
||||
Assert.True (ckb.AutoSize);
|
||||
@@ -235,7 +235,7 @@ public class CheckBoxTests
|
||||
Assert.Equal ("Test", ckb.Text);
|
||||
Assert.Equal ($"{CM.Glyphs.Checked} Test", ckb.TextFormatter.Text);
|
||||
Assert.True (ckb.CanFocus);
|
||||
Assert.Equal (new Rect (0, 0, 6, 1), ckb.Frame);
|
||||
Assert.Equal (new Rectangle (0, 0, 6, 1), ckb.Frame);
|
||||
|
||||
ckb = new CheckBox { Text = "Test", X = 1, Y = 2 };
|
||||
Assert.True (ckb.AutoSize);
|
||||
@@ -244,7 +244,7 @@ public class CheckBoxTests
|
||||
Assert.Equal ("Test", ckb.Text);
|
||||
Assert.Equal ($"{CM.Glyphs.UnChecked} Test", ckb.TextFormatter.Text);
|
||||
Assert.True (ckb.CanFocus);
|
||||
Assert.Equal (new Rect (1, 2, 6, 1), ckb.Frame);
|
||||
Assert.Equal (new Rectangle (1, 2, 6, 1), ckb.Frame);
|
||||
|
||||
ckb = new CheckBox { Text = "Test", X = 3, Y = 4, Checked = true };
|
||||
Assert.True (ckb.AutoSize);
|
||||
@@ -253,7 +253,7 @@ public class CheckBoxTests
|
||||
Assert.Equal ("Test", ckb.Text);
|
||||
Assert.Equal ($"{CM.Glyphs.Checked} Test", ckb.TextFormatter.Text);
|
||||
Assert.True (ckb.CanFocus);
|
||||
Assert.Equal (new Rect (3, 4, 6, 1), ckb.Frame);
|
||||
Assert.Equal (new Rectangle (3, 4, 6, 1), ckb.Frame);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -308,8 +308,8 @@ public class CheckBoxTests
|
||||
} Test
|
||||
";
|
||||
|
||||
Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 6, 1), pos);
|
||||
Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rectangle (0, 0, 6, 1), pos);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -333,7 +333,7 @@ public class CheckBoxTests
|
||||
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
|
||||
|
||||
Assert.Equal (TextAlignment.Centered, checkBox.TextAlignment);
|
||||
Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox.Frame);
|
||||
Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size);
|
||||
Assert.False (checkBox.AutoSize);
|
||||
|
||||
@@ -347,8 +347,8 @@ public class CheckBoxTests
|
||||
└────────────────────────────┘
|
||||
";
|
||||
|
||||
Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
|
||||
checkBox.Checked = true;
|
||||
Application.Refresh ();
|
||||
@@ -364,7 +364,7 @@ public class CheckBoxTests
|
||||
";
|
||||
|
||||
pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -398,10 +398,10 @@ public class CheckBoxTests
|
||||
((FakeDriver)Application.Driver).SetBufferSize (30, 6);
|
||||
|
||||
Assert.Equal (TextAlignment.Justified, checkBox1.TextAlignment);
|
||||
Assert.Equal (new Rect (1, 1, 25, 1), checkBox1.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox1.Frame);
|
||||
Assert.Equal (new Size (25, 1), checkBox1.TextFormatter.Size);
|
||||
Assert.Equal (TextAlignment.Justified, checkBox2.TextAlignment);
|
||||
Assert.Equal (new Rect (1, 2, 25, 1), checkBox2.Frame);
|
||||
Assert.Equal (new Rectangle (1, 2, 25, 1), checkBox2.Frame);
|
||||
Assert.Equal (new Size (25, 1), checkBox2.TextFormatter.Size);
|
||||
|
||||
var expected = @$"
|
||||
@@ -417,14 +417,14 @@ public class CheckBoxTests
|
||||
└────────────────────────────┘
|
||||
";
|
||||
|
||||
Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 6), pos);
|
||||
Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 6), pos);
|
||||
|
||||
checkBox1.Checked = true;
|
||||
Assert.Equal (new Rect (1, 1, 25, 1), checkBox1.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox1.Frame);
|
||||
Assert.Equal (new Size (25, 1), checkBox1.TextFormatter.Size);
|
||||
checkBox2.Checked = true;
|
||||
Assert.Equal (new Rect (1, 2, 25, 1), checkBox2.Frame);
|
||||
Assert.Equal (new Rectangle (1, 2, 25, 1), checkBox2.Frame);
|
||||
Assert.Equal (new Size (25, 1), checkBox2.TextFormatter.Size);
|
||||
Application.Refresh ();
|
||||
|
||||
@@ -442,7 +442,7 @@ public class CheckBoxTests
|
||||
";
|
||||
|
||||
pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 6), pos);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 6), pos);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -465,7 +465,7 @@ public class CheckBoxTests
|
||||
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
|
||||
|
||||
Assert.Equal (TextAlignment.Left, checkBox.TextAlignment);
|
||||
Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox.Frame);
|
||||
Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size);
|
||||
|
||||
var expected = @$"
|
||||
@@ -478,8 +478,8 @@ public class CheckBoxTests
|
||||
└────────────────────────────┘
|
||||
";
|
||||
|
||||
Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
|
||||
checkBox.Checked = true;
|
||||
Application.Refresh ();
|
||||
@@ -495,7 +495,7 @@ public class CheckBoxTests
|
||||
";
|
||||
|
||||
pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -519,7 +519,7 @@ public class CheckBoxTests
|
||||
((FakeDriver)Application.Driver).SetBufferSize (30, 5);
|
||||
|
||||
Assert.Equal (TextAlignment.Right, checkBox.TextAlignment);
|
||||
Assert.Equal (new Rect (1, 1, 25, 1), checkBox.Frame);
|
||||
Assert.Equal (new Rectangle (1, 1, 25, 1), checkBox.Frame);
|
||||
Assert.Equal (new Size (25, 1), checkBox.TextFormatter.Size);
|
||||
Assert.False (checkBox.AutoSize);
|
||||
|
||||
@@ -533,8 +533,8 @@ public class CheckBoxTests
|
||||
└────────────────────────────┘
|
||||
";
|
||||
|
||||
Rect pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Rectangle pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
|
||||
checkBox.Checked = true;
|
||||
Application.Refresh ();
|
||||
@@ -550,6 +550,6 @@ public class CheckBoxTests
|
||||
";
|
||||
|
||||
pos = TestHelpers.AssertDriverContentsWithFrameAre (expected, _output);
|
||||
Assert.Equal (new Rect (0, 0, 30, 5), pos);
|
||||
Assert.Equal (new Rectangle (0, 0, 30, 5), pos);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user