From e7f57b4e1b9ac4482374b10fdb3d7c4f2b966c70 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 13 Nov 2024 21:47:15 -0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=8E=BB=E9=99=A4=E8=AD=A6=E5=91=8A=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/DateTimeRangeTest.cs | 4 ++-- test/UnitTest/Components/InputNumberTest.cs | 2 +- test/UnitTest/Components/InputTest.cs | 4 ++-- test/UnitTest/Components/SelectTest.cs | 8 ++++---- test/UnitTest/Components/SelectTreeTest.cs | 4 ++-- test/UnitTest/Components/TransferTest.cs | 6 +++--- test/UnitTest/Components/ValidateFormTest.cs | 10 +++++----- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/test/UnitTest/Components/DateTimeRangeTest.cs b/test/UnitTest/Components/DateTimeRangeTest.cs index 013ef1864c5..0c61c6d9f40 100644 --- a/test/UnitTest/Components/DateTimeRangeTest.cs +++ b/test/UnitTest/Components/DateTimeRangeTest.cs @@ -285,7 +285,7 @@ await cut.InvokeAsync(() => //Assert.True(input.ClassList.Contains("datetime")); //Assert.True(DateTime.TryParseExact(input.GetAttribute("Value"), "MM/dd/yyyy HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out var _)); - // timeformat + // time format //cut.SetParametersAndRender(pb => //{ // pb.Add(a => a.TimeFormat, "hhmmss"); @@ -332,7 +332,7 @@ public void ValueChanged_Ok() var cut = Context.RenderComponent(builder => { builder.Add(a => a.Value, new DateTimeRangeValue { Start = DateTime.Now, End = DateTime.Now.AddDays(30) }); - builder.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => { value = v; })); + builder.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => { value = v; })); }); cut.FindAll(".is-confirm").First(s => s.TextContent == "清空").Click(); } diff --git a/test/UnitTest/Components/InputNumberTest.cs b/test/UnitTest/Components/InputNumberTest.cs index c8c920aa1a6..48e2a7da616 100644 --- a/test/UnitTest/Components/InputNumberTest.cs +++ b/test/UnitTest/Components/InputNumberTest.cs @@ -233,7 +233,7 @@ public override Task SetParametersAsync(ParameterView parameters) return Task.CompletedTask; } - protected override string? InternalFormat(string value) + protected override string? InternalFormat(string? value) { return base.InternalFormat(value); } diff --git a/test/UnitTest/Components/InputTest.cs b/test/UnitTest/Components/InputTest.cs index ead43b649aa..e3209b4242a 100644 --- a/test/UnitTest/Components/InputTest.cs +++ b/test/UnitTest/Components/InputTest.cs @@ -77,7 +77,7 @@ public async Task OnInput_Ok() { builder.Add(a => a.Value, foo.Name); builder.Add(a => a.UseInputEvent, true); - builder.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => + builder.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => { foo.Name = v; })); @@ -336,7 +336,7 @@ public void OnValueChanged_Ok() var cut = Context.RenderComponent>(builder => { builder.Add(a => a.Value, foo.Name); - builder.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => + builder.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => { foo.Name = v; })); diff --git a/test/UnitTest/Components/SelectTest.cs b/test/UnitTest/Components/SelectTest.cs index 17cc5a21280..25b73e47196 100644 --- a/test/UnitTest/Components/SelectTest.cs +++ b/test/UnitTest/Components/SelectTest.cs @@ -436,7 +436,7 @@ public void SelectItem_Ok() new("2", "Text2"), }); pb.Add(a => a.Value, v); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, i => v = i)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, i => v = i)); }); Assert.Equal("2", cut.Instance.Value.Value); @@ -771,7 +771,7 @@ public void IsVirtualize_BindValue() { pb.Add(a => a.Value, value); pb.Add(a => a.IsVirtualize, true); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, new Action(item => + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, new Action(item => { value = item; }))); @@ -812,13 +812,13 @@ public void IsVirtualize_BindValue() [Fact] public void IsVirtualize_DefaultVirtualizeItemText() { - string value = "3"; + string? value = "3"; var cut = Context.RenderComponent>(pb => { pb.Add(a => a.IsVirtualize, true); pb.Add(a => a.DefaultVirtualizeItemText, "Test 3"); pb.Add(a => a.Value, value); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, new Action(item => + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, new Action(item => { value = item; }))); diff --git a/test/UnitTest/Components/SelectTreeTest.cs b/test/UnitTest/Components/SelectTreeTest.cs index 366d92a64eb..200b3b7a535 100644 --- a/test/UnitTest/Components/SelectTreeTest.cs +++ b/test/UnitTest/Components/SelectTreeTest.cs @@ -69,7 +69,7 @@ public async Task Value_Null() { c.Add(p => p.Items, BindItems); c.Add(p => p.Value, model.Name); - c.Add(p => p.ValueChanged, EventCallback.Factory.Create(this, s => model.Name = s)); + c.Add(p => p.ValueChanged, EventCallback.Factory.Create(this, s => model.Name = s)); c.Add(p => p.ValueExpression, Utility.GenerateValueExpression(model, nameof(model.Name), typeof(string))); }); }); @@ -89,7 +89,7 @@ public async Task Valid_Ok() { c.Add(p => p.Items, BindItems); c.Add(p => p.Value, model.Name); - c.Add(p => p.ValueChanged, EventCallback.Factory.Create(this, s => model.Name = s)); + c.Add(p => p.ValueChanged, EventCallback.Factory.Create(this, s => model.Name = s)); c.Add(p => p.ValueExpression, Utility.GenerateValueExpression(model, nameof(model.Name), typeof(string))); }); }); diff --git a/test/UnitTest/Components/TransferTest.cs b/test/UnitTest/Components/TransferTest.cs index 871ae58c501..7df68c6ba10 100644 --- a/test/UnitTest/Components/TransferTest.cs +++ b/test/UnitTest/Components/TransferTest.cs @@ -10,7 +10,7 @@ public class TransferTest : BootstrapBlazorTestBase [Fact] public void Items_Ok() { - // 未设置 Itms 为空 + // 未设置 Items 为空 var cut = Context.RenderComponent>(); cut.Contains("class=\"transfer\""); @@ -136,7 +136,7 @@ public async Task ValidateForm_Ok() pb.AddChildContent>(pb => { pb.Add(a => a.Value, foo.Name); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(Context, v => foo.Name = v)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(Context, v => foo.Name = v)); pb.Add(a => a.ValueExpression, foo.GenerateValueExpression()); pb.Add(a => a.Items, new List() { @@ -187,7 +187,7 @@ public void MaxMin_Ok() var cut = Context.RenderComponent>(pb => { pb.Add(a => a.Value, foo.Name); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); pb.Add(a => a.ValueExpression, Utility.GenerateValueExpression(foo, "Name", typeof(string))); pb.Add(a => a.Items, new List() { diff --git a/test/UnitTest/Components/ValidateFormTest.cs b/test/UnitTest/Components/ValidateFormTest.cs index e74f5d1969a..3c5712045d6 100644 --- a/test/UnitTest/Components/ValidateFormTest.cs +++ b/test/UnitTest/Components/ValidateFormTest.cs @@ -47,7 +47,7 @@ public async Task Validate_Ok() pb.AddChildContent>(pb => { pb.Add(a => a.Value, foo.Name); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); pb.Add(a => a.ValueExpression, foo.GenerateValueExpression()); }); }); @@ -78,7 +78,7 @@ public void OnFieldValueChanged_Ok() pb.AddChildContent>(pb => { pb.Add(a => a.Value, foo.Name); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); pb.Add(a => a.ValueExpression, foo.GenerateValueExpression()); }); }); @@ -105,7 +105,7 @@ public void ValidateAllProperties_Ok() pb.AddChildContent>(pb => { pb.Add(a => a.Value, foo.Name); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); pb.Add(a => a.ValueExpression, foo.GenerateValueExpression()); }); }); @@ -125,7 +125,7 @@ public void ShowRequiredMark_Ok() pb.AddChildContent>(pb => { pb.Add(a => a.Value, foo.Name); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); pb.Add(a => a.ValueExpression, foo.GenerateValueExpression()); }); }); @@ -149,7 +149,7 @@ public void ShowLabel_Ok() pb.AddChildContent>(pb => { pb.Add(a => a.Value, foo.Name); - pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); + pb.Add(a => a.ValueChanged, EventCallback.Factory.Create(this, v => foo.Name = v)); pb.Add(a => a.ValueExpression, foo.GenerateValueExpression()); }); });