@Test public void test_massInLbs() { m1 = Values.massInKg(1); m2 = Values.massInLbs(2.20462262); m3 = Values.massInLbs(1102.31131); m4 = Values.massInLbs(5511.55655); m5 = Values.massInLbs(1104.51593262); m6 = Values.massInLbs(4409.24524); m7 = Values.ZERO_MASS; assertEquals(m4, m3.mul(5)); assertEquals(m3.kg(), m4.div(5).kg(), 0.01); assertEquals(m5.kg(), m1.add(m3).kg(), 4d); assertEquals(m6.kg(), m4.sub(m3).kg(), 0.01); assertTrue(m7.isZero()); assertTrue("500,00".equals(m3.toString())); assertEquals(m1, m2); }
@Test public void test_massInKg() { m1 = Values.massInKg(1); m2 = Values.massInKg(1); m3 = Values.massInKg(500); m4 = Values.massInKg(2500); m5 = Values.massInKg(501); m6 = Values.massInKg(2000); m7 = Values.ZERO_MASS; assertEquals(m1, m2); assertEquals(m4, m3.mul(5)); assertEquals(m3, m4.div(5)); assertEquals(m5, m1.add(m3)); assertEquals(m6, m4.sub(m3)); assertTrue(m7.isZero()); assertTrue("500,00".equals(m3.toString())); assertEquals("500,00", m3.toString()); }
@Test public void test_massInG() { m1 = Values.massInKg(1); m2 = Values.massInG(1000); m3 = Values.massInG(500); m4 = Values.massInG(2500); m5 = Values.massInG(1500); m6 = Values.massInG(2000); assertEquals(m4, m3.mul(5)); assertEquals(m3, m4.div(5)); assertEquals(m5, m1.add(m3)); assertEquals(m6, m4.sub(m3)); assertTrue(!m6.isZero()); assertTrue("0,50".equals(m3.toString())); assertEquals(m1, m2); }