Package kompleksnaStevila

Source Code of kompleksnaStevila.IllegalArgumentExceptionTest

package kompleksnaStevila;

import kompleksnaStevila.Complex;
import org.junit.Test;

public class IllegalArgumentExceptionTest {

    Complex c1;

    @Test(expected = IllegalArgumentException.class)
    public void testNumberFormatException() {
        c1 = new Complex("hg");
        c1.add(new Complex(3, 4));
        System.out.println(c1);
    }

    @Test(expected = IllegalArgumentException.class)
    public void testNumberFormatExceptionNaN() {
        c1 = new Complex("NaN");
    }

    @Test(expected = IllegalArgumentException.class)
    public void testNumberFormatExceptionInfinity() {
        c1 = new Complex("Infinity");
    }

    @Test(expected = IllegalArgumentException.class)
    public void testNumberFormatExceptionNonsense() {
        c1 = new Complex("0.2+s.0");
    }

    @Test(expected = IllegalArgumentException.class)
    public void testNumberFormatExceptionNonsenseMinus() {
        c1 = new Complex("0.2-s.0");
    }
}
TOP

Related Classes of kompleksnaStevila.IllegalArgumentExceptionTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.