Skip to content

Commit 5142269

Browse files
committed
test: 增加单元测试
1 parent eefcc13 commit 5142269

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the Apache 2.0 License
3+
// See the LICENSE file in the project root for more information.
4+
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
5+
6+
using System.Text.Json;
7+
8+
namespace UnitTest.Converters;
9+
10+
public class ColumnVisibleItemConverterTest
11+
{
12+
[Fact]
13+
public void ColumnVisibleItemConverter_Ok()
14+
{
15+
var item = new ColumnVisibleItem("name", true) { DisplayName = "display" };
16+
var json = JsonSerializer.Serialize(item);
17+
Assert.Equal("{\"name\":\"name\",\"visible\":true}", json);
18+
19+
var item2 = JsonSerializer.Deserialize<List<ColumnVisibleItem>>("[{\"test\":\"test\"}]");
20+
}
21+
}

0 commit comments

Comments
 (0)