Files
RobustToolbox/SS14.UnitTesting/Client/Graphics/StyleBoxTest.cs
2019-02-25 00:43:48 +01:00

36 lines
1.0 KiB
C#

using NUnit.Framework;
using SS14.Client.Graphics.Drawing;
using SS14.Shared.Maths;
namespace SS14.UnitTesting.Client.Graphics
{
[TestFixture]
[Parallelizable(ParallelScope.All)]
[TestOf(typeof(StyleBox))]
public 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)));
}
}
}