Skip to content

Commit

Permalink
[issue-154] Promoted the local variables in the test to state variabl…
Browse files Browse the repository at this point in the history
…e to remove duplication.
  • Loading branch information
hemalvarambhia committed Sep 8, 2019
1 parent e54af6f commit baa265b
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/Math-Tests-Accuracy/PMAccuracyFindKeyTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,37 @@ This test case exercises the findKey: message with some regression tests.
Class {
#name : #PMAccuracyFindKeyTest,
#superclass : #TestCase,
#instVars : [
'accuracy'
],
#category : #'Math-Tests-Accuracy'
}

{ #category : #tests }
PMAccuracyFindKeyTest >> testFindKeyReturnsAllTheRestStringWhenSelectorCorrespondsToNonExistentProperty [
| accuracy |
{ #category : #running }
PMAccuracyFindKeyTest >> setUp [
super setUp.
accuracy := PMAccuracyTestExample new.

self assert: (accuracy findKey: 'NonExistent') equals: 'AllTheRest'
]

{ #category : #tests }
PMAccuracyFindKeyTest >> testFindKeyReturnsAllTheRestStringWhenSelectorCorrespondsToNonExistentProperty [
| selector |
selector := 'NonExistent'.
self assert: (accuracy findKey: selector) equals: 'AllTheRest'
]

{ #category : #tests }
PMAccuracyFindKeyTest >> testFindKeyReturnsAllTheRestStringWhenSelectorIsInitialize [
| accuracy selector |
accuracy := PMAccuracyTestExample new.
| selector |
selector := 'initialize'.

self assert: (accuracy findKey: selector) equals: 'AllTheRest'
]

{ #category : #tests }
PMAccuracyFindKeyTest >> testFindKeyReturnsPropertyWhenSelectorIsSuffixOfInitializePropertyMessage [
| accuracy |
accuracy := PMAccuracyTestExample new.

self assert: (accuracy findKey: 'Aaa') equals: 'Aaa'
| selector |
selector := 'Aaa'.
self assert: (accuracy findKey: selector) equals: selector
]

0 comments on commit baa265b

Please sign in to comment.