mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-08-01 08:18:20 -04:00
* Move all unit tests to Engine/Tests * Fix Margin.EdgeSubtract * Fix Capsule.Contains * EnvironmentVariables.Remove if it's null * Fixed ray trace never returning startedsolid * Fix HistoryList.Navigate on empty list * Fix GameObject.WorldPosition accepting NaNs * Fix flex: initial expanding to the wrong grow/shrink * Translation.TryConvert shouldn't throw on invalid enum strings * Skip sound file tests on machines with no audio device
32 lines
749 B
C#
32 lines
749 B
C#
using Sandbox.UI;
|
|
|
|
namespace SystemTests;
|
|
|
|
[TestClass]
|
|
public class TextRenderingScopeTest
|
|
{
|
|
[TestMethod]
|
|
public void HashCodeIncludesFontVariantNumeric()
|
|
{
|
|
var normal = TextRendering.Scope.Default;
|
|
normal.FontVariantNumeric = FontVariantNumeric.Normal;
|
|
|
|
var tabular = normal;
|
|
tabular.FontVariantNumeric = FontVariantNumeric.TabularNums;
|
|
|
|
Assert.AreNotEqual( normal.GetHashCode(), tabular.GetHashCode() );
|
|
}
|
|
|
|
[TestMethod]
|
|
public void ToStyleCopiesFontVariantNumeric()
|
|
{
|
|
var scope = TextRendering.Scope.Default;
|
|
scope.FontVariantNumeric = FontVariantNumeric.TabularNums;
|
|
|
|
var style = new Topten.RichTextKit.Style();
|
|
scope.ToStyle( style );
|
|
|
|
Assert.AreEqual( FontVariantNumeric.TabularNums, style.FontVariantNumeric );
|
|
}
|
|
}
|