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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
now testing out-parameters w/o explicitly passing values
  • Loading branch information
eirannejad committed Jan 14, 2022
commit 961bd19e20cf1abdab8e7ba8a9a426308fe56b31
38 changes: 38 additions & 0 deletions tests/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@ def test_string_out_params():
assert result[1] == "output string"


def test_string_out_params_without_passing_string_value():
"""Test use of string out-parameters."""
# @eirannejad 2022-01-13
result = MethodTest.TestStringOutParams("hi")
assert isinstance(result, tuple)
assert len(result) == 2
assert result[0] is True
assert result[1] == "output string"


def test_string_ref_params():
"""Test use of string byref parameters."""
result = MethodTest.TestStringRefParams("hi", "there")
Expand Down Expand Up @@ -308,6 +318,16 @@ def test_value_out_params():
MethodTest.TestValueOutParams("hi", None)


def test_value_out_params_without_passing_string_value():
"""Test use of string out-parameters."""
# @eirannejad 2022-01-13
result = MethodTest.TestValueOutParams("hi")
assert isinstance(result, tuple)
assert len(result) == 2
assert result[0] is True
assert result[1] == 42


def test_value_ref_params():
"""Test use of value type byref parameters."""
result = MethodTest.TestValueRefParams("hi", 1)
Expand Down Expand Up @@ -336,6 +356,15 @@ def test_object_out_params():
assert isinstance(result[1], System.Exception)


def test_object_out_params_without_passing_string_value():
"""Test use of object out-parameters."""
result = MethodTest.TestObjectOutParams("hi")
assert isinstance(result, tuple)
assert len(result) == 2
assert result[0] is True
assert isinstance(result[1], System.Exception)


def test_object_ref_params():
"""Test use of object byref parameters."""
result = MethodTest.TestObjectRefParams("hi", MethodTest())
Expand Down Expand Up @@ -364,6 +393,15 @@ def test_struct_out_params():
MethodTest.TestValueRefParams("hi", None)


def test_struct_out_params_without_passing_string_value():
"""Test use of struct out-parameters."""
result = MethodTest.TestStructOutParams("hi")
assert isinstance(result, tuple)
assert len(result) == 2
assert result[0] is True
assert isinstance(result[1], System.Guid)


def test_struct_ref_params():
"""Test use of struct byref parameters."""
result = MethodTest.TestStructRefParams("hi", System.Guid.NewGuid())
Expand Down