diff options
Diffstat (limited to 'actionwebservice/test')
-rw-r--r-- | actionwebservice/test/abstract_client.rb | 7 | ||||
-rw-r--r-- | actionwebservice/test/client_soap_test.rb | 6 | ||||
-rw-r--r-- | actionwebservice/test/client_xmlrpc_test.rb | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/actionwebservice/test/abstract_client.rb b/actionwebservice/test/abstract_client.rb index b443fa8ffb..88f886f05f 100644 --- a/actionwebservice/test/abstract_client.rb +++ b/actionwebservice/test/abstract_client.rb @@ -19,6 +19,7 @@ module ClientTest api_method :array_return, :returns => [[Person]] api_method :struct_pass, :expects => [[Person]], :returns => [:bool] api_method :client_container, :returns => [:int] + api_method :named_parameters, :expects => [{:key=>:string}, {:id=>:int}] end class NullLogOut @@ -32,6 +33,7 @@ module ClientTest attr :value_normal attr :value_array_return attr :value_struct_pass + attr :value_named_parameters def initialize @session = @assigns = {} @@ -39,6 +41,7 @@ module ClientTest @value_normal = nil @value_array_return = nil @value_struct_pass = nil + @value_named_parameters = nil end def void @@ -66,6 +69,10 @@ module ClientTest 50 end + def named_parameters + @value_named_parameters = @method_params + end + def protocol_request(request) probe_request_protocol(request) end diff --git a/actionwebservice/test/client_soap_test.rb b/actionwebservice/test/client_soap_test.rb index 82ccef6f1b..5d62b05c82 100644 --- a/actionwebservice/test/client_soap_test.rb +++ b/actionwebservice/test/client_soap_test.rb @@ -84,4 +84,10 @@ class TC_ClientSoap < Test::Unit::TestCase def test_client_container assert_equal(50, ClientContainer.new.get_client.client_container) end + + def test_named_parameters + assert(@container.value_named_parameters.nil?) + assert(@client.named_parameters("key", 5).nil?) + assert_equal(["key", 5], @container.value_named_parameters) + end end diff --git a/actionwebservice/test/client_xmlrpc_test.rb b/actionwebservice/test/client_xmlrpc_test.rb index f9be9bfe16..cd393fbad6 100644 --- a/actionwebservice/test/client_xmlrpc_test.rb +++ b/actionwebservice/test/client_xmlrpc_test.rb @@ -83,4 +83,10 @@ class TC_ClientXmlRpc < Test::Unit::TestCase def test_client_container assert_equal(50, ClientContainer.new.get_client.client_container) end + + def test_named_parameters + assert(@container.value_named_parameters.nil?) + assert_equal(true, @client.named_parameters("xxx", 7)) + assert_equal(["xxx", 7], @container.value_named_parameters) + end end |