Skip to content

Commit a4cc93f

Browse files
committed
test: 增加单元测试
1 parent 41a6d31 commit a4cc93f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/UnitTest/Extensions/ObjectExtensionsTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ public static void IsNumber_Ok(Type source, bool expect)
4444
Assert.Equal(expect, actual);
4545
}
4646

47+
[Fact]
48+
public void IsNumber_Culture()
49+
{
50+
var culture = new CultureInfo("es-ES");
51+
CultureInfo.CurrentCulture = culture;
52+
Assert.False(typeof(long).IsNumber());
53+
54+
culture = new CultureInfo("en-US");
55+
CultureInfo.CurrentCulture = culture;
56+
Assert.True(typeof(long).IsNumber());
57+
}
58+
4759
[Theory]
4860
[InlineData(typeof(DateTime?), true)]
4961
[InlineData(typeof(DateTime), true)]

0 commit comments

Comments
 (0)