tx guys for your help. cleaning the garden (was a junggle -well still). On Sun, Apr 22, 2018 at 12:18 PM, Hilaire <hilaire@drgeo.eu> wrote:
Le 22/04/2018 à 05:25, Gregg Williams a écrit :
2) In testAllIsogramSet, why do you need âselfâ? After all âisogramsâ is a data structure, and its message is âdo:â
You defined isograms as a method of the class. Therefore only this method returns the data structure you defined there. It is not an instance variable declared in your GramCheckerTest class. In that case you may want to initialize it in your initialize GramCheckerTest class (or for a test case it is better to do it it in the setUp method as it will be called before each test method call):
initialize super initialize. isograms := #('pharo' 'pathfinder' 'xavier' 'lumberjacksâ)
Then your test method can access it directly (without self):
isograms do: [ :word | self assert: word isIsogramSet ]
Hilaire
-- Dr. Geo http://drgeo.eu