Skip to content

Commit e4f90ab

Browse files
committed
Add method object exception tests
1 parent 38067f4 commit e4f90ab

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/testing/methodtest.cs

+10
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ public static string TestOverloadedObjectTwo(object a, object b)
151151
return "Got object-object";
152152
}
153153

154+
public static string TestOverloadedObjectThree(object a, int b)
155+
{
156+
return "Got object-int";
157+
}
158+
159+
public static string TestOverloadedObjectThree(int a, object b)
160+
{
161+
return "Got int-object";
162+
}
163+
154164
public static bool TestStringOutParams(string s, out string s1)
155165
{
156166
s1 = "output string";

src/tests/test_method.py

+7
Original file line numberDiff line numberDiff line change
@@ -806,3 +806,10 @@ def test_object_in_multiparam():
806806

807807
res = MethodTest.TestOverloadedObjectTwo("foo", "bar")
808808
assert res == "Got object-object"
809+
810+
811+
def test_object_in_multiparam_exception():
812+
"""Test method with object multiparams behaves"""
813+
814+
with pytest.raises(TypeError):
815+
MethodTest.TestOverloadedObjectThree("foo", "bar")

0 commit comments

Comments
 (0)