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");
}
}