dotnet 9 and sequential id
All checks were successful
.NET Test / test (push) Successful in 49s
.NET Publish / publish (push) Successful in 41s

This commit is contained in:
2025-08-01 22:21:42 +04:00
parent 2b68ba982d
commit 3665abaab8
14 changed files with 428 additions and 68 deletions

View File

@@ -36,7 +36,7 @@ public class Decode
var actualBytesArray = Base32.Decode(str);
actualBytesArray.Should().Equal(expected);
}
[Theory]
[InlineData("ZFXJMF5N====", new byte[] { 0b11001001, 0b01101110, 0b10010110, 0b00010111, 0b10101101, })]
[InlineData("CPIKTMY=====", new byte[] { 0b00010011, 0b11010000, 0b10101001, 0b10110011, })]
@@ -72,7 +72,7 @@ public class Decode
[Theory]
[InlineData(null)]
[InlineData("")]
public void WhenCalledWithNullString_ShouldReturnEmptyArray(string testString)
public void WhenCalledWithNullString_ShouldReturnEmptyArray(string? testString)
{
Base32.Decode(testString).Should().BeEmpty();
}

View File

@@ -23,6 +23,9 @@ public class Encode
[InlineData("GSHXGB5ORKNDSFLSU2YWALI=")]
[InlineData("TMFSC64ZZNPQSNGCFIODS7TR")]
[InlineData("ZTDUBU4QZFFMDJKBII334EIB")]
[InlineData("2IO2HTALCXZWCBD2AAAAAAAAAAAA====")]
[InlineData("WXYEOQUZULMCY6ZQTDOLTRUZZMKQ====")]
[InlineData("FG4M3ZQM3TVWDMBUP5L7N7V3JS7KBM2E")]
public void WhenDecodedFromString_ShouldBeEncodedToTheSameString(string testString)
{
var resultBytes = Base32.Decode(testString);
@@ -34,6 +37,8 @@ public class Encode
[Theory]
[InlineData("FG4M3ZQM3TVWDMBUP5L7N7V3JS7KBM2E", new byte[] { 0x29, 0xb8, 0xcd, 0xe6, 0x0c, 0xdc, 0xeb, 0x61, 0xb0, 0x34, 0x7f, 0x57, 0xf6, 0xfe, 0xbb, 0x4c, 0xbe, 0xa0, 0xb3, 0x44, })]
[InlineData("WXYEOQUZULMCY6ZQTDOLTRUZZMKQ====", new byte[] { 0xb5, 0xf0, 0x47, 0x42, 0x99, 0xa2, 0xd8, 0x2c, 0x7b, 0x30, 0x98, 0xdc, 0xb9, 0xc6, 0x99, 0xcb, 0x15, })]
[InlineData("2IO2HTALCXZWCBD2AAAAAAAAAAAA====", new byte[] { 0xd2, 0x1d, 0xa3, 0xcc, 0x0b, 0x15, 0xf3, 0x61, 0x04, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, })]
[InlineData("2IO2HTALCXZWCBD2AAAAAAAA", new byte[] { 0xd2, 0x1d, 0xa3, 0xcc, 0x0b, 0x15, 0xf3, 0x61, 0x04, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, })]
[InlineData("2IO2HTALCXZWCBD2", new byte[] { 0xd2, 0x1d, 0xa3, 0xcc, 0x0b, 0x15, 0xf3, 0x61, 0x04, 0x7a, })]
[InlineData("ZFXJMF5N", new byte[] { 0b11001001, 0b01101110, 0b10010110, 0b00010111, 0b10101101, })]
[InlineData("CPIKTMY=", new byte[] { 0b00010011, 0b11010000, 0b10101001, 0b10110011, })]
@@ -48,7 +53,7 @@ public class Encode
[Theory]
[InlineData(new byte[] { })]
[InlineData(null)]
public void WhenCalledWithEmptyByteArray_ShouldReturnEmptyString(byte[] testArray)
public void WhenCalledWithEmptyByteArray_ShouldReturnEmptyString(byte[]? testArray)
{
var actualBase32 = Base32.Encode(testArray);
actualBase32.Should().Be(string.Empty);
@@ -57,7 +62,7 @@ public class Encode
[Theory]
[InlineData(new byte[] { })]
[InlineData(null)]
public void WhenCalledWithEmptyByteArray_ShouldReturnZeroAndNotChangeOutput(byte[] testArray)
public void WhenCalledWithEmptyByteArray_ShouldReturnZeroAndNotChangeOutput(byte[]? testArray)
{
char[] output = ['1', '2', '3', '4'];