ComplexTestpublic class ComplexTest extends TestCase
Methods Summary |
---|
public void | testAdd()
Complex a = new Complex(3,-1);
Complex b = new Complex(1, 5);
Complex sum = Complex.add(a, b);
assertEquals("add test", new Complex(4, 4), sum);
| public void | testEquals()
Complex c = new Complex(Math.PI, -Math.PI);
assertEquals("equality test", c, c);
| public void | testMultiply()
Complex c = new Complex(3, 5);
Complex d = new Complex(2, -2);
Complex m = new Complex(16.0, 4.0);
| public void | testToString()
assertEquals("toString Test", "3.4-5.6i",
new Complex(3.4, -5.6).toString());
|
|