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>
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using NUnit.Framework;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Robust.UnitTesting.Client.Graphics
|
|
{
|
|
[TestFixture]
|
|
[Parallelizable(ParallelScope.All)]
|
|
[TestOf(typeof(StyleBox))]
|
|
public sealed class StyleBoxTest
|
|
{
|
|
[Test]
|
|
public void TestGetEnvelopBox()
|
|
{
|
|
var styleBox = new StyleBoxFlat();
|
|
|
|
Assert.That(
|
|
styleBox.GetEnvelopBox(Vector2.Zero, new Vector2(50, 50)),
|
|
Is.EqualTo(new UIBox2(0, 0, 50, 50)));
|
|
|
|
styleBox.ContentMarginLeftOverride = 3;
|
|
styleBox.ContentMarginTopOverride = 5;
|
|
styleBox.ContentMarginRightOverride = 7;
|
|
styleBox.ContentMarginBottomOverride = 11;
|
|
|
|
Assert.That(
|
|
styleBox.GetEnvelopBox(Vector2.Zero, new Vector2(50, 50)),
|
|
Is.EqualTo(new UIBox2(0, 0, 60, 66)));
|
|
|
|
Assert.That(
|
|
styleBox.GetEnvelopBox(new Vector2(10, 10), new Vector2(50, 50)),
|
|
Is.EqualTo(new UIBox2(10, 10, 70, 76)));
|
|
}
|
|
}
|
|
}
|