Mark Rizun schreef op 2-4-2014 13:51:
Hi,

You probably misunderstood the task. 


On the first part I have to make a class named BlankCell which is a subclass of TestCase.
 
You had to create the class BlankCellTestCase (not BlankCell) which is a subclass of TestCase.
BlankCell and BlankCellTestCase are two different classes.
-BlankCell is a class that represents a model of an empty cell (its size, segments etc.)
-BlankCellTestCase is basically a class that helps you to control (and test) methods that you have on BlankCell class.

But when you are on the MirrorCell part BlankCell must be a subclass of Cell.
 

You are right here.
Cell class is an abstract, which is a superclass for following classes: BlankCell, MirrorCell, TargetCell. 
It provides some basic behavior or properties for BlankCell, MirrorCell, TargetCell, which all of them have in common

But then the tests will fail because should:  cannot be found.
 


I have now these classes :

TestCase subclass: #BlankCellTestCase
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Laser-Game-Tests'

Object subclass: #Cell
    instanceVariableNames: 'activateSegments exitSides'
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Laser-Game-Model'

Cell subclass: #BlankCell
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Laser-Game-Model'

And only on this method the test fail on should:

testCellOnState
      | cell |
      cell := BlankCell new.
      cell should: [ cell isOff ].
      cell shouldnt:  [ cell isOn ].


Roelof

Reply via email to