Skip to content

Commit af0222c

Browse files
committed
test: 更新单元测试
1 parent 563774d commit af0222c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/UnitTest/Components/SearchTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ public async Task ItemTemplate_Ok()
5050
[Fact]
5151
public async Task OnGetDisplayText_Ok()
5252
{
53-
var items = new List<Foo>() { new() { Name = "test1", Address = "Address 1" }, new() { Name = "test2", Address = "Address 2" } };
54-
var cut = Context.RenderComponent<Search<Foo>>(pb =>
53+
var items = new List<Foo?>() { null, new() { Name = "test1", Address = "Address 1" }, new() { Name = "test2", Address = "Address 2" } };
54+
var cut = Context.RenderComponent<Search<Foo?>>(pb =>
5555
{
5656
pb.Add(a => a.OnSearch, async v =>
5757
{
5858
await Task.Delay(1);
5959
return items;
6060
});
61-
pb.Add(a => a.OnGetDisplayText, foo => foo.Name);
61+
pb.Add(a => a.OnGetDisplayText, foo => foo?.Name);
6262
});
6363

6464
await cut.InvokeAsync(() => cut.Instance.TriggerOnChange("t"));

0 commit comments

Comments
 (0)