@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()); }
@Test public void test_accInMss() { acc1 = Values.accInMss(5); acc2 = Values.accInMss(5); acc3 = Values.accInMss(10); assertEquals(acc1, acc2); assertEquals(acc3, acc1.add(acc2)); assertEquals(acc2, acc3.sub(acc1)); assertEquals(acc3, acc1.mul(2)); assertEquals(acc1, acc3.div(2)); assertTrue(acc1.compareTo(acc2) == 0); assertTrue(acc1.compareTo(acc3) == -1); assertTrue(acc3.compareTo(acc1) == 1); assertTrue(acc1.equals(acc1)); assertTrue(!acc1.isZero()); assertTrue("5,00".equals(acc1.toString())); assertTrue(5.0 == acc1.mss()); }