Skip to content

Commit a3975ee

Browse files
committed
refactor: 更新 HexConveter 文档注释
1 parent ef43651 commit a3975ee

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/extensions/BootstrapBlazor.Socket/DataConverter/HexConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace BootstrapBlazor.Components.DataConverter;
88

99
/// <summary>
10-
/// Byte 数组扩展方法
10+
/// 十六进制 与 Byte 数组转换方法
1111
/// </summary>
1212
public static class HexConverter
1313
{
@@ -46,7 +46,7 @@ public static string ToString(byte[]? bytes, string? separator = "-")
4646
/// <param name="separator"></param>
4747
/// <param name="options"></param>
4848
/// <returns></returns>
49-
public static byte[] ToByte(string str, string? separator = null, StringSplitOptions options = StringSplitOptions.None)
49+
public static byte[] ToBytes(string str, string? separator = null, StringSplitOptions options = StringSplitOptions.None)
5050
{
5151
// 把 str 内的 delimiter 符号替换掉
5252
if (!string.IsNullOrEmpty(separator))
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
1+
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

55
using BootstrapBlazor.Components.DataConverter;
66

77
namespace UnitTestTcpSocket;
88

9-
public class ExtensionsTest
9+
public class HexConverterTest
1010
{
1111
[Fact]
1212
public void ToHexString_Ok()
@@ -20,20 +20,20 @@ public void ToHexString_Ok()
2020
}
2121

2222
[Fact]
23-
public void ToByte_Ok()
23+
public void ToBytes_Ok()
2424
{
2525
var excepted = new byte[] { 0x1A, 0x02, 0x13, 0x04, 0xFE };
2626

2727
var data = "1A021304FE";
28-
var actual = HexConverter.ToByte(data);
28+
var actual = HexConverter.ToBytes(data);
2929
Assert.Equal(excepted, actual);
3030

3131
data = "1A-02-13-04-FE";
32-
actual = HexConverter.ToByte(data, "-");
32+
actual = HexConverter.ToBytes(data, "-");
3333
Assert.Equal(excepted, actual);
3434

3535
data = "1A 02 13 04 FE";
36-
actual = HexConverter.ToByte(data, " ");
36+
actual = HexConverter.ToBytes(data, " ");
3737
Assert.Equal(excepted, actual);
3838
}
3939
}

0 commit comments

Comments
 (0)