ps1.test
Class RatNumTest
java.lang.Object
ps1.test.RatNumTest
public final class RatNumTest
extends Object
This class contains a set of test cases that can be used to test the
implementation of the RatNum class.
RatNum is implemented for you, so it should already pass all the tests in
this suite. This test is provided to give you (1) examples of using the
RatNum class, albeit in the context of a test driver and (2) an example of a
test suite.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RatNumTest
public RatNumTest()
testOneArgConstructor
public void testOneArgConstructor()
testTwoArgConstructor
public void testTwoArgConstructor()
testIsNaN
public void testIsNaN()
testIsPosAndIsNeg
public void testIsPosAndIsNeg()
testDoubleValue
public void testDoubleValue()
testFloatValue
public void testFloatValue()
testIntValue
public void testIntValue()
testEqualsReflexive
public void testEqualsReflexive()
- This test check is equals is reflexive. In other words that x.equals(x)
is always true.
testEquals
public void testEquals()
testToStringSimple
public void testToStringSimple()
testToStringFractions
public void testToStringFractions()
testToStringNaN
public void testToStringNaN()
testValueOf
public void testValueOf()
testNegate
public void testNegate()
testAddSimple
public void testAddSimple()
testAddComplex
public void testAddComplex()
testAddImproper
public void testAddImproper()
testAddOnNaN
public void testAddOnNaN()
testAddTransitively
public void testAddTransitively()
testSubSimple
public void testSubSimple()
testSubComplex
public void testSubComplex()
testSubImproper
public void testSubImproper()
testSubOnNaN
public void testSubOnNaN()
testSubTransitively
public void testSubTransitively()
testMulProperties
public void testMulProperties()
testMulSimple
public void testMulSimple()
testMulComplex
public void testMulComplex()
testMulImproper
public void testMulImproper()
testMulOnNaN
public void testMulOnNaN()
testMulTransitively
public void testMulTransitively()
testDivSimple
public void testDivSimple()
testDivComplex
public void testDivComplex()
testDivImproper
public void testDivImproper()
testDivOnNaN
public void testDivOnNaN()
testDivTransitively
public void testDivTransitively()
testCompareToReflexive
public void testCompareToReflexive()
testCompareToNonFract
public void testCompareToNonFract()
testCompareToFract
public void testCompareToFract()
testCompareToNaNs
public void testCompareToNaNs()