author | Jaroslav Tulach <jtulach@netbeans.org> |
Sat, 14 Feb 2009 17:30:06 +0100 | |
changeset 321 | 06bf3a32eaa0 |
permissions | -rw-r--r-- |
jtulach@321 | 1 |
/* |
jtulach@321 | 2 |
* Žluťoučký kůň je naše hříbátko. |
jtulach@321 | 3 |
* and open the template in the editor. |
jtulach@321 | 4 |
*/ |
jtulach@321 | 5 |
|
jtulach@321 | 6 |
package org.apidesign.math.test; |
jtulach@321 | 7 |
|
jtulach@321 | 8 |
import junit.framework.TestCase; |
jtulach@321 | 9 |
|
jtulach@321 | 10 |
/** |
jtulach@321 | 11 |
* |
jtulach@321 | 12 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jtulach@321 | 13 |
*/ |
jtulach@321 | 14 |
public class FactorialTest extends TestCase { |
jtulach@321 | 15 |
|
jtulach@321 | 16 |
public FactorialTest(String testName) { |
jtulach@321 | 17 |
super(testName); |
jtulach@321 | 18 |
} |
jtulach@321 | 19 |
|
jtulach@321 | 20 |
@Override |
jtulach@321 | 21 |
protected void setUp() throws Exception { |
jtulach@321 | 22 |
super.setUp(); |
jtulach@321 | 23 |
} |
jtulach@321 | 24 |
|
jtulach@321 | 25 |
@Override |
jtulach@321 | 26 |
protected void tearDown() throws Exception { |
jtulach@321 | 27 |
super.tearDown(); |
jtulach@321 | 28 |
} |
jtulach@321 | 29 |
|
jtulach@321 | 30 |
public void testFactorial3() { |
jtulach@321 | 31 |
if (Boolean.getBoolean("no.failures")) return; |
jtulach@321 | 32 |
assertEquals(6, Factorial.factorial(3)); |
jtulach@321 | 33 |
} |
jtulach@321 | 34 |
|
jtulach@321 | 35 |
public void testFactorial4() { |
jtulach@321 | 36 |
if (Boolean.getBoolean("no.failures")) return; |
jtulach@321 | 37 |
assertEquals(24, Factorial.factorial(4)); |
jtulach@321 | 38 |
} |
jtulach@321 | 39 |
|
jtulach@321 | 40 |
public void testFactorial5() { |
jtulach@321 | 41 |
if (Boolean.getBoolean("no.failures")) return; |
jtulach@321 | 42 |
assertEquals(120, Factorial.factorial(5)); |
jtulach@321 | 43 |
} |
jtulach@321 | 44 |
} |