Completed
Push — master ( 064eaa...847d00 )
by Siwapun
06:40 queued 04:59
created

MedianTest::testMedianWithOddNumberOfArguments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Aerophant\RamdaTest;
4
5
use function Aerophant\Ramda\median;
6
use PHPUnit\Framework\TestCase;
7
8
class MedianTest extends TestCase
9
{
10
  public function testMedianWithOddNumberOfArguments()
11
  {
12
    $numbers = [2, 9, 7];
13
    $expect = 7;
14
    $actual = median()($numbers);
15
    $this->assertEquals($expect, $actual);
16
  }
17
18
  public function testMedianWithEvenNumberOfArguments()
19
  {
20
    $numbers = [7, 2, 10, 9];
21
    $expect = 8;
22
    $actual = median()($numbers);
23
    $this->assertEquals($expect, $actual);
24
  }
25
}
26