Example #1
0
  @Test
  public void test_gcdWithPercentOperation_a_b_negative() {
    // setup
    // - nothing

    // action
    final int result = MathUtils.gcdWithPercentOperation(-VALUE_1, -VALUE_2);

    // check
    assertEquals(VALUE_ANSWER, result);
  }
Example #2
0
  @Test
  public void test_gcdWithRem_b_negative_asc() {
    // setup
    // - nothing

    // action
    final int result = MathUtils.gcdWithRem(VALUE_2, -VALUE_1);

    // check
    assertEquals(VALUE_ANSWER, result);
  }
Example #3
0
  @Test
  public void test_gcdWithRem_zero_negative() {
    // setup
    // - nothing

    // action
    final int result = MathUtils.gcdWithRem(-VALUE_ANSWER, 0);

    // check
    assertEquals(-VALUE_ANSWER, result);
  }
Example #4
0
  @Test
  public void test_gcdWithFloorMod_a_negative() {
    // setup
    // - nothing

    // action
    final int result = MathUtils.gcdWithFloorMod(-VALUE_1, VALUE_2);

    // check
    assertEquals(VALUE_ANSWER, result);
  }
Example #5
0
  @Test
  public void test_gcdWithFloorMod_zero() {
    // setup
    // - nothing

    // action
    final int result = MathUtils.gcdWithFloorMod(VALUE_ANSWER, 0);

    // check
    assertEquals(VALUE_ANSWER, result);
  }
Example #6
0
 @Test
 public void testAdd() throws Exception {
   assertEquals(MathUtils.add(2, 2), 4);
 }