Skip to content

Commit f762aa5

Browse files
committed
test: 增加单元测试
1 parent 0df7e28 commit f762aa5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/UnitTest/Extensions/ObjectExtensionsTest.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,19 @@ public void IsStatic_Ok()
303303
Assert.True(pi.IsStatic());
304304
}
305305

306+
[Fact]
307+
public void CreateInstanceWithCascade_Ok()
308+
{
309+
var exception = Assert.ThrowsAny<Exception>(() => ObjectExtensions.CreateInstanceWithCascade<MockComplexObject>(true));
310+
}
311+
312+
private class MockComplexObject
313+
{
314+
public Foo? Foo { get; set; }
315+
316+
public (string Name, int Count)[]? Test { get; set; }
317+
}
318+
306319
private class MockStatic
307320
{
308321
private static int _test;

0 commit comments

Comments
 (0)