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
This commit is contained in:
parent
4ad8811df2
commit
525cda5413
266 changed files with 1348 additions and 1800 deletions
|
|
@ -5,8 +5,7 @@ namespace Server.Tests.Accounting
|
|||
{
|
||||
public class HexStringConverterTest
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("ABCDEF1234", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||
[Theory, InlineData("ABCDEF1234", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||
public void TestGetBytes(string input, byte[] bytes)
|
||||
{
|
||||
Span<byte> outputBytes = stackalloc byte[input.Length / 2];
|
||||
|
|
@ -16,8 +15,7 @@ namespace Server.Tests.Accounting
|
|||
Assert.Equal(input, bytes.ToHexString());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("[AB, CD, EF, 12, 34]", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||
[Theory, InlineData("[AB, CD, EF, 12, 34]", new byte[] { 0xAB, 0xCD, 0xEF, 0x12, 0x34 })]
|
||||
public void TestsGetStringDelimited(string expected, byte[] bytes)
|
||||
{
|
||||
Assert.Equal(expected, bytes.ToDelimitedHexString());
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@ 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")]
|
||||
[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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue