Calculator { public float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign) { float result = 0f; switch (sign) { case Sign.PLUS: result = firstNumberFloat + secondNumberFloat; break; case Sign.MINUS: result = firstNumberFloat - secondNumberFloat; break; case Sign.MULTIPLY: result = firstNumberFloat * secondNumberFloat; break; case Sign.DIVIDE: result = firstNumberFloat / secondNumberFloat; break; } return result; }  float makeCalculation(final float firstNumberFloat, final float secondNumberFloat, final String sign); Observable<Float> calculate(final String firstNumber, final String secondNumber, final String sign);  }
@Test public void testAddition() { assertEquals(5f, mCalculator.makeCalculation(2, 3, Sign.PLUS), DELTA); }
@Test public void testSubtraction() { assertEquals(18f, mCalculator.makeCalculation(21f, 3f, Sign.MINUS), DELTA); }
@Test public void testMultiplication() { assertEquals(80f, mCalculator.makeCalculation(10f, 8f, Sign.MULTIPLY), DELTA); }
@Test public void testDivision() { assertEquals(4f, mCalculator.makeCalculation(20f, 5f, Sign.DIVIDE), DELTA); }
@Test public void testInfinity() { assertEquals(Float.POSITIVE_INFINITY, mCalculator.makeCalculation(12f, 0f, Sign.DIVIDE), DELTA); }
@Test public void testNaN() { assertEquals(Float.NaN, mCalculator.makeCalculation(0f, 0f, Sign.DIVIDE), DELTA); }