Skip to content

Commit 4897227

Browse files
committed
test: 更新单元测试
1 parent 669e1c9 commit 4897227

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/BootstrapBlazor/Components/Input/BootstrapInput.razor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public partial class BootstrapInput<TValue>
2727
/// </summary>
2828
[Parameter]
2929
[Obsolete("已弃用,请使用 IsClearable 参数;Deprecated use the IsClearable parameter")]
30+
[ExcludeFromCodeCoverage]
3031
public bool Clearable { get => IsClearable; set => IsClearable = value; }
3132

3233
/// <summary>
@@ -46,6 +47,7 @@ public partial class BootstrapInput<TValue>
4647
/// </summary>
4748
[Parameter]
4849
[Obsolete("已弃用,请使用 ClearIcon 参数;Deprecated use the ClearIcon parameter")]
50+
[ExcludeFromCodeCoverage]
4951
public string? ClearableIcon { get => ClearIcon; set => ClearIcon = value; }
5052

5153
/// <summary>

test/UnitTest/Components/InputTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ public void Readonly_Ok()
7272
[Fact]
7373
public void Clearable_Ok()
7474
{
75-
var cut = Context.RenderComponent<BootstrapInput<string>>(builder => builder.Add(a => a.Clearable, false));
75+
var cut = Context.RenderComponent<BootstrapInput<string>>(builder => builder.Add(a => a.IsClearable, false));
7676
cut.DoesNotContain("bb-clearable-input");
7777

78-
cut.SetParametersAndRender(pb => pb.Add(a => a.Clearable, true));
78+
cut.SetParametersAndRender(pb => pb.Add(a => a.IsClearable, true));
7979
cut.Contains("bb-clearable-input");
8080
cut.Contains("form-control-clear-icon");
8181

@@ -93,7 +93,7 @@ public async Task OnClear_Ok()
9393
var clicked = false;
9494
var cut = Context.RenderComponent<BootstrapInput<string>>(builder =>
9595
{
96-
builder.Add(a => a.Clearable, true);
96+
builder.Add(a => a.IsClearable, true);
9797
builder.Add(a => a.OnClear, v =>
9898
{
9999
clicked = true;

0 commit comments

Comments
 (0)