Files
sbox-public/engine/Sandbox.Test.Unit/UI/Panel/BorderPadding.cs
Lorenz Junglas 91f8fcf183 Speed up / parallelize tests (#3587)
- Added Sandbox.Test.Unit project (contains independent tests that can run in parallel) 
- Modify some slow/stress tests (e.g. instead of doing a million iterations settle for 10k).

Tests run almost twice as fast now.
2025-12-10 14:23:00 +01:00

30 lines
665 B
C#

using Sandbox.UI;
namespace UITest.Panels;
[TestClass]
[DoNotParallelize] // Modfiies UI System Global
public partial class BorderPadding
{
[TestMethod]
public void BorderDoesntChangeSize()
{
var root = new RootPanel();
root.PanelBounds = new Rect( 0, 0, 1000, 1000 );
var panela = root.Add.Panel();
panela.Style.Set( "width: 100px; height: 100px;" );
root.Layout();
Assert.AreEqual( 100, panela.Box.Right );
Assert.AreEqual( 100, panela.Box.Bottom );
panela.Style.Set( "width: 100px; height: 100px; border: 10px solid red;" );
root.Layout();
Assert.AreEqual( 100, panela.Box.Right );
Assert.AreEqual( 100, panela.Box.Bottom );
}
}