feat: add world chat UI
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Reflection;
|
||||
using NUnit.Framework;
|
||||
using UnityEditor;
|
||||
|
||||
public sealed class XWorldJsonPrefabAutoConvertTests
|
||||
{
|
||||
private const string JsonPrefKey = "XWorld.UI.AutoConvertJsonOnFocus";
|
||||
private const string HtmlPrefKey = "XWorld.UI.AutoConvertHtmlOnFocus";
|
||||
|
||||
[TearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
EditorPrefs.DeleteKey(JsonPrefKey);
|
||||
EditorPrefs.DeleteKey(HtmlPrefKey);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void JsonAutoConvertDefaultsToEnabledIndependentlyOfHtmlPreference()
|
||||
{
|
||||
EditorPrefs.DeleteKey(JsonPrefKey);
|
||||
EditorPrefs.SetBool(HtmlPrefKey, false);
|
||||
|
||||
Assert.That(ReadJsonAutoConvertEnabled(), Is.True);
|
||||
}
|
||||
|
||||
private static bool ReadJsonAutoConvertEnabled()
|
||||
{
|
||||
MethodInfo method = typeof(XWorldUtil).GetMethod(
|
||||
"IsAutoConvertJsonOnFocusEnabled",
|
||||
BindingFlags.Static | BindingFlags.NonPublic);
|
||||
|
||||
Assert.That(method, Is.Not.Null);
|
||||
return (bool)method.Invoke(null, null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user