Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3770e5c

Browse files
committed
Add multiparameter method object tests
1 parenteb24ee4 commit3770e5c

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

‎src/testing/methodtest.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,26 @@ public static string TestOverloadedObject(object o)
131131
return"Got object";
132132
}
133133

134+
publicstaticstringTestOverloadedObjectTwo(inta,intb)
135+
{
136+
return"Got int-int";
137+
}
138+
139+
publicstaticstringTestOverloadedObjectTwo(inta,objectb)
140+
{
141+
return"Got int-object";
142+
}
143+
144+
publicstaticstringTestOverloadedObjectTwo(objecta,intb)
145+
{
146+
return"Got object-int";
147+
}
148+
149+
publicstaticstringTestOverloadedObjectTwo(objecta,objectb)
150+
{
151+
return"Got object-object";
152+
}
153+
134154
publicstaticboolTestStringOutParams(strings,outstrings1)
135155
{
136156
s1="output string";

‎src/tests/test_method.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,3 +790,19 @@ def test_object_in_param():
790790

791791
res=MethodTest.TestOverloadedObject("test")
792792
assertres=="Got object"
793+
794+
795+
deftest_object_in_multiparam():
796+
"""Test method with object multiparams behaves"""
797+
798+
res=MethodTest.TestOverloadedObjectTwo(5,5)
799+
assertres=="Got int-int"
800+
801+
res=MethodTest.TestOverloadedObjectTwo(5,"foo")
802+
assertres=="Got int-object"
803+
804+
res=MethodTest.TestOverloadedObjectTwo("foo",5)
805+
assertres=="Got object-int"
806+
807+
res=MethodTest.TestOverloadedObjectTwo("foo","bar")
808+
assertres=="Got object-object"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp