mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-05-24 06:46:26 -04:00
32 lines
749 B
C#
32 lines
749 B
C#
using Sandbox.UI;
|
|
|
|
namespace SystemTest;
|
|
|
|
[TestClass]
|
|
public class TextRenderingScopeTests
|
|
{
|
|
[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 );
|
|
}
|
|
}
|