コード例 #1
0
  @Test
  public void test_powerInKW() {
    p1 = Values.powerInKW(0.5);
    p2 = Values.powerInW(500);

    assertEquals(p1, p2);
  }
コード例 #2
0
  @Test
  public void test_forceInN() {
    f1 = Values.forceInN(500);
    f2 = Values.forceInN(500);
    f3 = Values.forceInN(1000);

    assertEquals(f1, f2);
    assertEquals(f3, f2.add(f1));
    assertEquals(f1, f3.sub(f2));
    assertEquals(f3, f2.mul(2));
    assertEquals(f1, f3.div(2));
    assertEquals(Values.powerInW(2500), f2.mul(Values.speedInMpS(5)));
    assertEquals(Values.accInMss(5), f1.div(Values.massInKg(100)));
    assertEquals(Values.massInKg(100), f1.div(Values.accInMss(5)));

    assertTrue(f1.compareTo(f2) == 0);
    assertTrue(f1.compareTo(f3) == -1);
    assertTrue(f3.compareTo(f1) == 1);

    assertTrue(f1.equals(f2));

    assertTrue(!f1.isZero());
    assertTrue("500,00".equals(f1.toString()));
    assertTrue(500.0 == f1.n());
    assertTrue(0.5 == f1.kn());
  }
コード例 #3
0
  @Test
  public void test_powerInW() {
    p1 = Values.powerInW(500);
    p2 = Values.powerInW(500);
    p3 = Values.powerInW(1000);

    assertEquals(p1, p2);
    assertEquals(p3, p2.add(p1));
    assertEquals(p1, p3.sub(p2));
    assertEquals(p3, p2.mul(2));
    assertEquals(p1, p3.div(2));
    assertEquals(Values.forceInN(50), p1.div(Values.speedInMpS(10)));

    assertTrue(p1.compareTo(p2) == 0);
    assertTrue(p1.compareTo(p3) == -1);
    assertTrue(p3.compareTo(p1) == 1);

    assertTrue(p1.equals(p2));

    assertTrue(!p1.isZero());
    assertTrue("500,00".equals(p1.toString()));
    assertTrue(500.0 == p1.w());
    assertTrue(0.5 == p1.kw());
  }