예제 #1
0
 public function testShouldReturnOne()
 {
     $matrix = new Matrix();
     $matrix->setSize(5);
     $matrix->setValues(array(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5));
     $analyzer = new MatrixAnalyzer();
     $analyzer->getGreaterProduct($matrix);
 }
예제 #2
0
 public function testShouldReturn16When5x5onLineOne()
 {
     $matrix = array(array(1, 2, 2, 2, 2), array(1, 1, 1, 1, 1), array(1, 1, 1, 1, 1), array(1, 1, 1, 1, 1), array(1, 1, 1, 1, 1));
     $matrixAnalyze = new MatrixAnalyzer($matrix);
     $expected = 16;
     $result = $matrixAnalyze->getMaxProduct();
     $this->assertEquals($result, $expected);
 }