| Class | RS::Test::RSTestProperties |
| In: |
rsil/test/rstestproperties.rb
|
| Parent: | Test::Unit::TestCase |
| Class: | RSTestProperties |
| File: | rstestproperties.rb |
| Purpose: | RSTestProperties includes methods to test class RS::Utils::RSTestProperties. |
| Created by: | Mario Pehle, 2006/05/02 |
| Required modules: | Test::Unit |
| Offers functions: | - |
| Description: | Sets up test object. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSProperties#new |
| Returns: | RSProperties |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestproperties.rb, line 44
44: def setup
45: @rsproperties = RS::Utils::RSProperties.new
46: end
| Description: | Deletes test object and calls garbage collector. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | GC#start |
| Returns: | nil |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestproperties.rb, line 60
60: def teardown
61: @rsproperties = nil
62: GC.start
63: end
| Description: | Tests RS::Utils::RSProperties#from_rsproperties for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSProperties#from_rsproperties |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestproperties.rb, line 104
104: def test_from_rsproperties
105: prop = RS::Utils::RSProperties.new
106: assert_not_same(
107: @rsproperties.objc_object,
108: prop.objc_object,
109: 'Same basic objects.'
110: )
111: assert_raise(ArgumentError) do
112: @rsproperties.from_rsproperties 'not rsprop'
113: end
114: assert_nothing_raised { @rsproperties.from_rsproperties(prop) }
115: end
| Description: | Tests RS::Utils::RSProperties#get for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSProperties#get |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestproperties.rb, line 149
149: def test_get
150: assert_raise(StandardError) { @rsproperties.get 'key' }
151: assert_nothing_raised { @rsproperties.set 'key', 'value' }
152: assert_nothing_raised { @rsproperties.get 'key' }
153: end
| Description: | Tests RS::Utils::RSProperties#new for correct initialization. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSProperties#new |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestproperties.rb, line 77
77: def test_initialize
78: assert_not_nil(
79: RS::Utils::RSProperties.new,
80: 'Parameterless initialization not failed.'
81: )
82: assert_raise(ArgumentError) { RS::Utils::RSProperties.new '0' }
83: assert_raise(ArgumentError) { RS::Utils::RSProperties.new '-1' }
84: assert_raise(ArgumentError) { RS::Utils::RSProperties.new 'arg' }
85: assert_kind_of(
86: OSX::OCObject,
87: RS::Utils::RSProperties.new.objc_object,
88: 'No objc object initialized.'
89: )
90: end
| Description: | Tests RS::Utils::RSProperties#objc_object for correct return value. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSProperties#objc_object |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestproperties.rb, line 167
167: def test_objc_object
168: assert_nothing_raised { @rsproperties.objc_object }
169: assert_not_nil(
170: @rsproperties.objc_object,
171: 'Basic objc object not initialized.'
172: )
173: end
| Description: | Tests RS::Utils::RSProperties#set for correct work. |
| Precondition: | - |
| Postcondition: | - |
| Exceptions: | - |
| Uses: | RS::Utils::RSProperties#set |
| Returns: | (not save) |
| Parameters: | Name | i/o/io | default | Meaning |
# File rsil/test/rstestproperties.rb, line 129
129: def test_set
130: assert_nothing_raised { @rsproperties.set 'key', 'value' }
131: assert_equal(
132: @rsproperties.get('key'),
133: 'value', 'Change in type or value.'
134: )
135: end