Marcel Taeumel uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-mt.27.mcz ==================== Summary ==================== Name: MorphicTests-mt.27 Author: mt Time: 8 April 2015, 8:35:19.162 pm UUID: 58811b46-58b0-5c45-abcb-7802187779d5 Ancestors: MorphicTests-mt.26 Tests added for Slider and ScrollBar. =============== Diff against MorphicTests-mt.26 =============== Item was added: + SliderTest subclass: #ScrollBarTest + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'MorphicTests-Widgets'! Item was added: + ----- Method: ScrollBarTest class>>shouldInheritSelectors (in category 'testing') ----- + shouldInheritSelectors + ^ true! Item was added: + ----- Method: ScrollBarTest>>subjectClass (in category 'running') ----- + subjectClass + + ^ ScrollBar! Item was added: + TestCase subclass: #SliderTest + instanceVariableNames: 'sut' + classVariableNames: '' + poolDictionaries: '' + category: 'MorphicTests-Widgets'! Item was added: + ----- Method: SliderTest>>setUp (in category 'running') ----- + setUp + + super setUp. + sut := self subjectClass + on: (ValueHolder new contents: 0.0) + getValue: #contents + setValue: #contents:. + sut extent: 400@20.! Item was added: + ----- Method: SliderTest>>subjectClass (in category 'running') ----- + subjectClass + + ^ Slider! Item was added: + ----- Method: SliderTest>>test01Value (in category 'tests') ----- + test01Value + + self assert: 0.0 equals: sut value. + self assert: 0.0 equals: sut model contents.! Item was added: + ----- Method: SliderTest>>test02SetValue (in category 'tests') ----- + test02SetValue + + sut setValue: 0.5. + self + assert: 0.5 equals: sut value; + assert: 0.5 equals: sut model contents.! Item was added: + ----- Method: SliderTest>>test03MinMax (in category 'tests') ----- + test03MinMax + + sut + minimumValue: 10; + maximumValue: 20. + + sut setValue: 5. + self assert: 10 equals: sut value truncated. + + sut setValue: 30. + self assert: 20 equals: sut value truncated. + + sut maximumValue: 15. + self assert: 15 equals: sut value truncated. + + sut setValue: 10. + sut minimumValue: 12. + self assert: 12 equals: sut value truncated. + ! Item was added: + ----- Method: SliderTest>>test04Descending (in category 'tests') ----- + test04Descending + + | px | + sut setValue: 0.3. + px := sut thumb position. + + sut descending: sut descending not. + self assert: px ~= sut thumb position.! Item was added: + ----- Method: SliderTest>>test05SliderWithoutModel (in category 'tests') ----- + test05SliderWithoutModel + + | swm | + swm := Slider new. + + self assert: 0.0 equals: swm value. + swm setValue: 0.6. + self assert: 0.6 equals: swm value.! Item was added: + ----- Method: SliderTest>>test06Truncate (in category 'tests') ----- + test06Truncate + + self assert: sut truncate not. + + sut maximumValue: 100. + sut truncate: true. + + sut setValue: 23.45. + self assert: 23 equals: sut value. + + sut setValue: 23.65. + self assert: 24 equals: sut value.! Item was added: + ----- Method: SliderTest>>test07Quantum (in category 'tests') ----- + test07Quantum + + sut maximumValue: 100. + sut quantum: 5. + + sut setValue: 23. + self assert: 25 equals: sut value.! Item was added: + ----- Method: SliderTest>>test08MinEqualsMax (in category 'tests') ----- + test08MinEqualsMax + + sut + maximumValue: 50; + minimumValue: 50. + + self assert: 50 equals: sut value.! Item was added: + ----- Method: SliderTest>>test09SliderWithoutGetter (in category 'tests') ----- + test09SliderWithoutGetter + + sut getValueSelector: nil. + sut setValue: 0.5. + + self assert: 0.5 equals: sut value. + self assert: 0.5 equals: sut model contents.! |
Free forum by Nabble | Edit this page |