ps1.test
Class RatNumTest
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
ps1.test.RatNumTest
- All Implemented Interfaces:
- Test
public final class RatNumTest
- extends TestCase
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.
Constructor Summary |
RatNumTest(String name)
This constructor is provided for junit's use. |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
RatNumTest
public RatNumTest(String name)
- This constructor is provided for junit's use.
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()