Files
RobustToolbox/Robust.UnitTesting/Client/UserInterface/Controls/CenterContainerTest.cs
T
AcruidandGitHub 2183cd7ca1 Massive Namespace Cleanup (#1544)
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
2021-02-10 23:27:19 -08:00

30 lines
911 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 class CenterContainerTest : RobustUnitTest
{
public override UnitTestProject Project => UnitTestProject.Client;
[Test]
public void Test()
{
var container = new CenterContainer {Size = (100, 100)};
var child = new Control {CustomMinimumSize = (50, 50)};
container.AddChild(child);
container.ForceRunLayoutUpdate();
Assert.That(container.CombinedMinimumSize, 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)));
}
}
}