@Test public void test8() throws Throwable { Rational rational0 = new Rational(1151L, 233L); Rational rational1 = rational0.multiply(1151L); assertEquals(5685.8413, rational1.floatValue(), 0.01F); assertEquals(4, rational0.shortValue()); }
/** * OVERVIEW: The test case "test8" covers around 5.0% (low percentage) of statements in "Rational" */ @Test public void test8() throws Throwable { // The test case instantiates a "Rational" with numerator equal to // -1394L, and denominator equal to -1394L. // The execution of this constructor implicitly covers the following 1 // conditions: // - the condition " denominator equals to 0L" is FALSE; Rational rational0 = new Rational((-1394L), (-1394L)); // The test case declares an object of the class "Rational" whose value // is obtained by multiplying long scalar to rational0 Rational rational1 = rational0.multiply(2L); // Then, it tests: // 1) whether the float value of "rational1" is equal // to 0.0042918455F with delta equal to 0.01F; assertEquals(2.0F, rational1.floatValue(), 0.01F); // 2) whether short value for the object "rational0" is equal to 1; // short value for the object "rational0" assertEquals(1, rational0.shortValue()); }