Skip to content

Commit 09ced9d

Browse files
committed
test: 更新 ByteConverter 单元测试
1 parent 9c7dddd commit 09ced9d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/UnitTestTcpSocket/TcpSocketPropertyConverterTest.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,15 @@ public void DoubleConverter_Ok()
6969
var actual = converter.Convert(new byte[] { 0x1F, 0x85, 0xEB, 0x51, 0xB8, 0x1E, 0x09, 0x40 });
7070
Assert.Equal(3.14, actual);
7171
}
72+
73+
[Fact]
74+
public void ByteConverter_Ok()
75+
{
76+
var converter = new DataByteConverter();
77+
var actual = converter.Convert(new byte[] { 0xFF });
78+
Assert.Equal((byte)0xFF, actual);
79+
80+
actual = converter.Convert(Array.Empty<byte>());
81+
Assert.Equal((byte)0x0, actual);
82+
}
7283
}

0 commit comments

Comments
 (0)