Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7acf93f

Browse files
committed
adding method Object tests
1 parent 6139989 commit 7acf93f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/testing/methodtest.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ public static int[] TestOverloadedParams(string v, params int[] args)
115115
return args;
116116
}
117117

118+
public static int TestOverloadedObject(int i)
119+
{
120+
return i;
121+
}
122+
123+
public static object TestOverloadedObject(object o)
124+
{
125+
return o;
126+
}
127+
118128
public static int[] TestOverloadedParams(int v, int[] args)
119129
{
120130
return args;

src/tests/test_method.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ def test():
341341
# None cannot be converted to a value type like int, long, etc.
342342
self.assertRaises(TypeError, test)
343343

344+
def testObjectInParam(self):
345+
MethodTest.TestOverloadedObject(5)
346+
MethodTest.TestOverloadedObject("test")
347+
344348
def testObjectOutParams(self):
345349
"""Test use of object out-parameters."""
346350
result = MethodTest.TestObjectOutParams("hi", MethodTest())

0 commit comments

Comments
 (0)