mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-02 18:17:09 +02:00
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
30 lines
906 B
C#
30 lines
906 B
C#
using NUnit.Framework;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Robust.UnitTesting.Client.UserInterface.Controls
|
|
{
|
|
[TestFixture]
|
|
[TestOf(typeof(CenterContainer))]
|
|
public sealed class CenterContainerTest : RobustUnitTest
|
|
{
|
|
public override UnitTestProject Project => UnitTestProject.Client;
|
|
|
|
[Test]
|
|
public void Test()
|
|
{
|
|
var container = new CenterContainer();
|
|
var child = new Control {MinSize = (50, 50)};
|
|
|
|
container.AddChild(child);
|
|
|
|
container.Arrange(UIBox2.FromDimensions(0, 0, 100, 100));
|
|
|
|
Assert.That(container.DesiredSize, Is.EqualTo(new Vector2(50, 50)));
|
|
Assert.That(child.Position, Is.EqualTo(new Vector2(25, 25)));
|
|
Assert.That(child.Size, Is.EqualTo(new Vector2(50, 50)));
|
|
}
|
|
}
|
|
}
|