mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
38 lines
938 B
C#
38 lines
938 B
C#
using Xunit.Abstractions;
|
|
|
|
namespace Terminal.Gui.LayoutTests;
|
|
|
|
public class PosAbsoluteTests (ITestOutputHelper output)
|
|
{
|
|
private readonly ITestOutputHelper _output = output;
|
|
|
|
[Fact]
|
|
public void PosAbsolute_Equal ()
|
|
{
|
|
Pos pos1 = Pos.Absolute (1);
|
|
Pos pos2 = Pos.Absolute (1);
|
|
Assert.Equal (pos1, pos2);
|
|
|
|
pos2 = Pos.Absolute (2);
|
|
Assert.NotEqual (pos1, pos2);
|
|
}
|
|
|
|
[Fact]
|
|
public void PosAbsolute_Calculate_ReturnsExpectedValue ()
|
|
{
|
|
var posAbsolute = new PosAbsolute (5);
|
|
int result = posAbsolute.Calculate (10, new DimAbsolute (2), null, Dimension.None);
|
|
Assert.Equal (5, result);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData (-1)]
|
|
[InlineData (0)]
|
|
[InlineData (1)]
|
|
public void PosAbsolute_SetsPosition (int position)
|
|
{
|
|
var pos = Pos.Absolute (position) as PosAbsolute;
|
|
Assert.Equal (position, pos!.Position);
|
|
}
|
|
}
|