Skip to content

Commit fd6a99e

Browse files
committed
Merge pull request #17 from diablohsh/master
add 4 new test unit
2 parents 2355e83 + 763065a commit fd6a99e

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

UnitTest/CLScriptExt/TestClass.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
public class TestClass
1010
{
11+
public TestClass()
12+
{
13+
}
14+
15+
public TestClass(byte b)
16+
{
17+
}
1118

1219
public string name
1320
{
@@ -45,4 +52,13 @@ public static bool TF(bool b)
4552
{
4653
return b;
4754
}
55+
56+
public static void TestObjectArg(Object o)
57+
{
58+
bool b = (bool)o;
59+
}
60+
61+
public static void TestByteArg(byte b)
62+
{
63+
}
4864
}

UnitTestDll/Test_ByDuskforest.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using UnitTest;
6+
using System.Collections;
7+
8+
namespace UnitTestDll
9+
{
10+
class Test_ByDuskforest
11+
{
12+
public static void UnitTest_Bool2Object()
13+
{
14+
TestClass.TestObjectArg(true);
15+
}
16+
17+
public static void UnitTest_Int2Byte()
18+
{
19+
TestClass.TestByteArg(32);
20+
}
21+
22+
public static void UnitTest_CtorWithNoArg()
23+
{
24+
//这行代码放在Program.cs里面执行是不会报错的
25+
System.Activator.CreateInstance(Type.GetType("TestClass"));
26+
}
27+
28+
public static void UnitTest_CtorWithByteArg()
29+
{
30+
//这行代码放在Program.cs里面执行是不会报错的
31+
System.Activator.CreateInstance(Type.GetType("TestClass"), new Object[] { (byte)32 });
32+
}
33+
}
34+
}

UnitTestDll/UnitTestDll.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<Compile Include="LightTestor\ExpTest_10.cs" />
6363
<Compile Include="Properties\AssemblyInfo.cs" />
6464
<Compile Include="Test_ByLynn.cs" />
65+
<Compile Include="Test_ByDuskforest.cs" />
6566
<Compile Include="test_enum.cs" />
6667
<Compile Include="test_string_switch.cs" />
6768
<Compile Include="没有实现的IL.cs" />

0 commit comments

Comments
 (0)