整合SLSUtilities

This commit is contained in:
SoulliesOfficial
2026-01-17 11:35:49 -05:00
parent d94241f36c
commit 7ee2894a63
1338 changed files with 3051541 additions and 507034 deletions

View File

@@ -0,0 +1,53 @@
using LunaWolfStudiosEditor.ScriptableSheets.Tables;
using NUnit.Framework;
using System.Text;
namespace LunaWolfStudiosEditor.ScriptableSheets.EditorTests
{
[TestFixture]
[Category(TestUtility.MainCategory)]
public class StringBuilderUtilityTests
{
[Test]
public void Wrap_WithOpenAndCloseChars_ShouldWrapValueCorrectly()
{
var sb = new StringBuilder();
sb.Wrap("text", '(', ')');
Assert.AreEqual("(text)", sb.ToString());
}
[Test]
public void Wrap_WithWrapperObject_ShouldWrapValueCorrectly()
{
var sb = new StringBuilder();
var wrapper = new Wrapper('[', ']');
sb.Wrap("value", wrapper);
Assert.AreEqual("[value]", sb.ToString());
}
[Test]
public void Wrap_WithWrapperObjectSingleChar_ShouldWrapValueCorrectly()
{
var sb = new StringBuilder();
var wrapper = new Wrapper('\"');
sb.Wrap("value", wrapper);
Assert.AreEqual("\"value\"", sb.ToString());
}
[Test]
public void Wrap_WithEmptyString_ShouldWrapEmptyStringCorrectly()
{
var sb = new StringBuilder();
sb.Wrap(string.Empty, '<', '>');
Assert.AreEqual("<>", sb.ToString());
}
[Test]
public void Wrap_WithNullValue_ShouldWrapNullValue()
{
var sb = new StringBuilder();
sb.Wrap(null, '{', '}');
Assert.AreEqual("{}", sb.ToString());
}
}
}