Calculator { public double pow(double firstOperand, double secondOperand) { return Math.pow(firstOperand,secondOperand); }  double add(double firstOperand, double secondOperand); double sub(double firstOperand, double secondOperand); double div(double firstOperand, double secondOperand); double mul(double firstOperand, double secondOperand); double pow(double firstOperand, double secondOperand);  }
@Test public void powPostInt() { double resultPow = mCalculator.pow(3d,2d); assertThat(resultPow, is(equalTo(9d))); }
@Test public void powNegFirstOpsEvenSecondOps() { double resultPow = mCalculator.pow(-3d,2d); assertThat(resultPow, is(equalTo(9d))); }
@Test public void powNegFirstOpsOddSecondOps() { double resultPow = mCalculator.pow(-3d,3d); assertThat(resultPow, is(equalTo(-27d))); }
@Test public void powNegSecondOps() { double resultPow = mCalculator.pow(3d,-3d); assertThat(resultPow, is(equalTo(1/27d))); }
@Test public void powFirstZeroPosSecondOps() { double resultPow = mCalculator.pow(0,2d); assertThat(resultPow, is(equalTo(0d))); }
@Test public void powZeroSecondOps() { double resultPow = mCalculator.pow(1d,0); assertThat(resultPow, is(equalTo(1d))); }
@Test public void powZeroFirstNegativeOneSecondOps() { double resultPow = mCalculator.pow(0,-1d); assertThat(resultPow, is(equalTo(Double.POSITIVE_INFINITY))); }
@Test public void powZeroFirstNegativeSecondOps() { double resultPow = mCalculator.pow(-0,-2d); assertThat(resultPow, is(equalTo(Double.POSITIVE_INFINITY))); }