diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-01-12 19:31:40 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-01-12 19:31:40 +0100 |
| commit | b2a66673c2d7d67fbb967c17c038814c4cec166c (patch) | |
| tree | b549a511feb65c090a6da94131770c4783564e79 /src/de/fhswf/in/inf/java1/aufgabe13/GeneralTests.java | |
| parent | ad9ec8854341770a84700d3df18c3a044a14f673 (diff) | |
| download | Java1-b2a66673c2d7d67fbb967c17c038814c4cec166c.tar.gz Java1-b2a66673c2d7d67fbb967c17c038814c4cec166c.zip | |
Assignment No.13 first implementation.
Diffstat (limited to 'src/de/fhswf/in/inf/java1/aufgabe13/GeneralTests.java')
| -rw-r--r-- | src/de/fhswf/in/inf/java1/aufgabe13/GeneralTests.java | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/de/fhswf/in/inf/java1/aufgabe13/GeneralTests.java b/src/de/fhswf/in/inf/java1/aufgabe13/GeneralTests.java new file mode 100644 index 0000000..4cbdf76 --- /dev/null +++ b/src/de/fhswf/in/inf/java1/aufgabe13/GeneralTests.java @@ -0,0 +1,75 @@ +/** + * + */ +package de.fhswf.in.inf.java1.aufgabe13; + +import org.junit.Test; + +import de.fhswf.in.inf.java1.aufgabe12.UPN; + +/** + * Test the UPN class. + * + * @author $Author: $ + * @version $Revision: $, $Date: $ UTC + */ +public class GeneralTests +{ + + /** + * Test method for + * {@link de.fhswf.in.inf.java1.aufgabe12.UPN#calculate(java.lang.String)}. + */ + @Test(expected = IllegalArgumentException.class) + public final void testInvalidNumbers() + { + // UPN is tested + UPN tester = new UPN(); + + // Test + tester.calculate("1g 3 +"); + } + + /** + * Test method for + * {@link de.fhswf.in.inf.java1.aufgabe12.UPN#calculate(java.lang.String)}. + */ + @Test(expected = IllegalArgumentException.class) + public final void testInvalidOperator() + { + // UPN is tested + UPN tester = new UPN(); + + // Test + tester.calculate("1 cinus"); + } + + /** + * Test method for + * {@link de.fhswf.in.inf.java1.aufgabe12.UPN#calculate(java.lang.String)}. + */ + @Test(expected = IllegalArgumentException.class) + public final void testMissingOperands() + { + // UPN is tested + UPN tester = new UPN(); + + // Test + tester.calculate("1 +"); + } + + /** + * Test method for + * {@link de.fhswf.in.inf.java1.aufgabe12.UPN#calculate(java.lang.String)}. + */ + @Test(expected = IllegalArgumentException.class) + public final void testDevisionByZero() + { + // UPN is tested + UPN tester = new UPN(); + + // Test + tester.calculate("1 0 /"); + } + +} |
