added more tests
All checks were successful
.NET Test / test (push) Successful in 1m6s
.NET Publish / publish (push) Successful in 38s

This commit is contained in:
2024-08-15 22:00:49 +04:00
parent 43135a5ffb
commit 2b68ba982d
9 changed files with 206 additions and 7 deletions

View File

@@ -43,8 +43,8 @@ public class Encode
{
var str = Base32.Encode(testArray);
str.Should().Be(expected);
}
}
[Theory]
[InlineData(new byte[] { })]
[InlineData(null)]
@@ -53,4 +53,17 @@ public class Encode
var actualBase32 = Base32.Encode(testArray);
actualBase32.Should().Be(string.Empty);
}
[Theory]
[InlineData(new byte[] { })]
[InlineData(null)]
public void WhenCalledWithEmptyByteArray_ShouldReturnZeroAndNotChangeOutput(byte[] testArray)
{
char[] output = ['1', '2', '3', '4'];
var charsWritten = Base32.Encode(testArray, output);
charsWritten.Should().Be(0);
output.Should().Equal(['1', '2', '3', '4']);
}
}