Section 5

There are still 2 unit tests that are failing.

When we open up the debugger on the failing test we again see it's obviously related to the changes in the cell sizes. Here's the existing test case method.

testClicksInIgnoreRegion     | pt regionClass |
    pt := 1@1.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self should: [regionClass = CellClickRegionIgnore].
    pt := 29@29.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self should: [regionClass = CellClickRegionIgnore].
    pt := 3@3.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self should: [regionClass = CellClickRegionIgnore].
    pt := 10@10.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self shouldnt: [regionClass = CellClickRegionIgnore].

Change the method as follows and we will pass this test.

testClicksInIgnoreRegion
    | pt regionClass |
    pt := 1@1.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self should: [regionClass = CellClickRegionIgnore].
    pt := 39@39.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self should: [regionClass = CellClickRegionIgnore].
    pt := 3@3.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self should: [regionClass = CellClickRegionIgnore].
    pt := 10@10.
    regionClass := CellClickRegion clickRegionForPoint: pt.
    self shouldnt: [regionClass = CellClickRegionIgnore].

Index Page Next Page

Copyright © 2007, 2008, 2009, 2010 Stephan B Wessels    stevewessels@me.com