Files
Terminal.Gui/Tests/UnitTestsParallelizable/Drawing/CellTests.cs
Tig fdeaa8331b Fixes #4298 - Updates test namespaces (#4299)
* Refactored test namespaces.
Moved some tests that were in wrong project.
Code cleanup

* Parrallel -> Parallel
2025-10-20 14:14:38 -06:00

53 lines
1.1 KiB
C#

using System.Text;
using Xunit.Abstractions;
namespace UnitTests_Parallelizable.DrawingTests;
public class CellTests ()
{
[Fact]
public void Constructor_Defaults ()
{
var c = new Cell ();
Assert.True (c is { });
Assert.Equal (0, c.Rune.Value);
Assert.Null (c.Attribute);
}
[Fact]
public void Equals_False ()
{
var c1 = new Cell ();
var c2 = new Cell
{
Rune = new ('a'), Attribute = new (Color.Red)
};
Assert.False (c1.Equals (c2));
Assert.False (c2.Equals (c1));
c1.Rune = new ('a');
c1.Attribute = new ();
Assert.Equal (c1.Rune, c2.Rune);
Assert.False (c1.Equals (c2));
Assert.False (c2.Equals (c1));
}
[Fact]
public void ToString_Override ()
{
var c1 = new Cell ();
var c2 = new Cell
{
Rune = new ('a'), Attribute = new (Color.Red)
};
Assert.Equal ("['\0':]", c1.ToString ());
Assert.Equal (
"['a':[Red,Red,None]]",
c2.ToString ()
);
}
}