ModernUO/Projects/Server.Tests/Tests/Utility/StringHelperTests.cs
Kamron Batman 525cda5413
Cleanup & Fixes for .NET 5 (#309)
- [X] Fixes several bugs
- [X] Updates more ordinal issues
- [X] Cleans up the code a bit
- [X] Turns classes static that should have been
- [X] Changes TcpServer.Instances to a HashSet

Bumps release version
2020-11-15 10:03:50 -08:00

16 lines
521 B
C#

using Xunit;
namespace Server.Tests
{
public class TestStringHelpers
{
[Theory, InlineData(null, "default value", "default value"), InlineData("", "default value", "default value"),
InlineData("this is a valid string", "default value", "this is a valid string")]
public void TestIsNullOrDefault(string value, string defaultValue, string expected)
{
var actual = value.DefaultIfNullOrEmpty(defaultValue);
Assert.Equal(expected, actual);
}
}
}