Skip to content

Commit ca551f0

Browse files
committed
test: 更新单元测试
1 parent 45d2a4c commit ca551f0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

test/UnitTest/Components/TableTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public async Task Items_Add(InsertRowMode insertMode, bool bind)
127127
{
128128
pb.AddChildContent<Table<Foo>>(pb =>
129129
{
130+
pb.Add(a => a.IsAutoInitializeModelProperty, true);
130131
pb.Add(a => a.Items, items);
131132
if (bind)
132133
{

test/UnitTest/Extensions/ObjectExtensionsTest.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,11 @@ public void IsStatic_Ok()
306306
[Fact]
307307
public void CreateInstance_Ok()
308308
{
309-
var exception = Assert.ThrowsAny<Exception>(() => ObjectExtensions.CreateInstanceWithCascade<MockComplexObject>(true));
309+
var exception = Assert.ThrowsAny<Exception>(() => ObjectExtensions.CreateInstance<MockComplexObject>(true));
310+
311+
var mi = typeof(ObjectExtensions).GetMethod("EnsureInitialized", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
312+
Assert.NotNull(mi);
313+
mi.Invoke(null, [null, false]);
310314
}
311315

312316
private class MockComplexObject

0 commit comments

Comments
 (0)