|
@@ 24-31 (lines=8) @@
|
| 21 |
|
/** |
| 22 |
|
* @dataProvider count_provider |
| 23 |
|
*/ |
| 24 |
|
public function test_count(Point $lowerLeft, Point $upperRight, $expectedCount) |
| 25 |
|
{ |
| 26 |
|
$producer = new RectangularFromTwoPoints($lowerLeft, $upperRight); |
| 27 |
|
$field = $producer->produce(); |
| 28 |
|
|
| 29 |
|
$actualCount = $field->count(); |
| 30 |
|
static::assertEquals($expectedCount, $actualCount); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
public function point_belongs_to_rectangular_provider() |
| 34 |
|
{ |
|
@@ 51-58 (lines=8) @@
|
| 48 |
|
/** |
| 49 |
|
* @dataProvider point_belongs_to_rectangular_provider |
| 50 |
|
*/ |
| 51 |
|
public function test_point_belongs_to_rectangular(Point $lowerLeft, Point $upperRight, Point $testPoint, $expectedIn) |
| 52 |
|
{ |
| 53 |
|
$producer = new RectangularFromTwoPoints($lowerLeft, $upperRight); |
| 54 |
|
$field = $producer->produce(); |
| 55 |
|
|
| 56 |
|
$actualIn = $field->contains($testPoint); |
| 57 |
|
static::assertEquals($expectedIn, $actualIn); |
| 58 |
|
} |
| 59 |
|
} |
| 60 |
|
|