Files
Terminal.Gui/Tests/UnitTestsParallelizable/Drawing/RulerTests.cs
Copilot ed64f5773e Fixes #4282 - Migrate tests from UnitTests to UnitTests.Parallelizable (67 tests migrated + comprehensive documentation) (#4293)
* Initial plan

* Add 31 parallelizable LineCanvas unit tests

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Add 4 parallelizable Ruler unit tests

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Complete Category A migration - 35 tests migrated

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Remove duplicate tests from UnitTests after migration to Parallelizable

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Migrate 6 pure unit tests from ColorPicker and DatePicker to Parallelizable

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix duplicate test names between UnitTests and Parallelizable

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Migrate 11 Label tests to Parallelizable (52 tests total)

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Fix documentation: SetupFakeDriver tests CAN be parallelized

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Add comprehensive parallelization rules to documentation

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Update README and start migrating Button/CheckBox/RadioGroup tests

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Remove duplicate Button tests from UnitTests

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Migrate 5 CheckBox unit tests to Parallelizable (27 with Theory expansion)

Co-authored-by: tig <585482+tig@users.noreply.github.com>

* Migrate 4 more CheckBox tests to Parallelizable (67 tests total, 9,478 passing)

Co-authored-by: tig <585482+tig@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
2025-10-19 19:04:43 -06:00

47 lines
1.3 KiB
C#

namespace Terminal.Gui.DrawingTests;
/// <summary>
/// Pure unit tests for <see cref="Ruler"/> that don't require Application.Driver or View context.
/// These tests focus on properties and behavior that don't depend on rendering.
///
/// Note: Tests that verify rendered output (Draw methods) require Application.Driver and remain in UnitTests as integration tests.
/// </summary>
public class RulerTests : UnitTests.Parallelizable.ParallelizableBase
{
[Fact]
public void Constructor_Defaults ()
{
var r = new Ruler ();
Assert.Equal (0, r.Length);
Assert.Equal (Orientation.Horizontal, r.Orientation);
}
[Fact]
public void Attribute_Set ()
{
var newAttribute = new Attribute (Color.Red, Color.Green);
var r = new Ruler ();
r.Attribute = newAttribute;
Assert.Equal (newAttribute, r.Attribute);
}
[Fact]
public void Length_Set ()
{
var r = new Ruler ();
Assert.Equal (0, r.Length);
r.Length = 42;
Assert.Equal (42, r.Length);
}
[Fact]
public void Orientation_Set ()
{
var r = new Ruler ();
Assert.Equal (Orientation.Horizontal, r.Orientation);
r.Orientation = Orientation.Vertical;
Assert.Equal (Orientation.Vertical, r.Orientation);
}
}