Example #1
0
 public function testAdd()
 {
     $calc = new Calculator();
     $result = $calc->add(30, 12);
     // assert that your calculator added the numbers correctly!
     $this->assertEquals(42, $result);
 }
 /**
  * Given a known amount, test if the result is correct.
  *
  * @param  void
  * @return void
  */
 public function testBillsAreCorrrect()
 {
     $mockup = [100 => 1, 50 => 1, 20 => 1, 10 => 1];
     $calc = new Calculator();
     $result = $calc->getResult(180);
     $this->assertEquals($result, $mockup);
 }
Example #3
0
 public function testMul()
 {
     $calc = new Calculator();
     $result = $calc->mul(30, 10);
     // assert that your calculator added the numbers correctly!
     $this->assertEquals(300, $result);
 }
Example #4
0
 public function testAdd()
 {
     $calc = new Calculator();
     $result = $calc->add(30, 12);
     $this->assertEquals(42, $result);
 }