Skip to content

Commit 8ab1b24

Browse files
committed
test: 增加单元测试
1 parent 48ac1da commit 8ab1b24

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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([email protected]) Website: https://www.blazor.zone
5+
6+
namespace UnitTest.Components;
7+
8+
public class FilterLogicItemTest : BootstrapBlazorTestBase
9+
{
10+
[Fact]
11+
public async Task FilterLogicItem_Ok()
12+
{
13+
var logic = FilterLogic.And;
14+
var cut = Context.RenderComponent<FilterLogicItem>(pb =>
15+
{
16+
pb.Add(a => a.Logic, FilterLogic.And);
17+
pb.Add(a => a.LogicChanged, EventCallback.Factory.Create<FilterLogic>(this, v =>
18+
{
19+
logic = v;
20+
}));
21+
});
22+
23+
var select = cut.FindComponent<Select<FilterLogic>>();
24+
await cut.InvokeAsync(() => select.Instance.SetValue(FilterLogic.Or));
25+
Assert.Equal(FilterLogic.Or, logic);
26+
}
27+
}

0 commit comments

Comments
 (0)