File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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" />
You can’t perform that action at this time.
0 commit comments