Updated dependencies. Use new array initializer in C#. Added comments to alot of methods and classes

This commit is contained in:
martin
2023-12-06 23:43:21 +01:00
parent 2520a9ed94
commit 9991bac6fa
32 changed files with 458 additions and 160 deletions

View File

@ -3,9 +3,15 @@ using pacMan.Utils;
namespace BackendTests.Utils;
[TestFixture]
[TestOf(nameof(Extensions))]
public class ExtensionsTests
{
#region ToArraySegment(this object obj)
[SetUp]
public void Setup()
{
_bytes = "Hello World!"u8.ToArray();
}
[Test]
public void ToArraySegmentValidObject()
@ -24,18 +30,8 @@ public class ExtensionsTests
Assert.That(segment, Has.Count.EqualTo(4));
}
#endregion
#region GetString(this byte[] bytes, int length)
private byte[] _bytes = null!;
[SetUp]
public void Setup()
{
_bytes = "Hello World!"u8.ToArray();
}
[Test]
public void GetString_ValidByteArray()
{
@ -65,6 +61,4 @@ public class ExtensionsTests
{
Assert.That(_bytes.GetString(_bytes.Length / 2), Is.EqualTo("Hello "));
}
#endregion
}