samples/composition/src-test/api/FactorialTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 10:04:53 +0200
changeset 210 acf2c31e22d4
parent 209 1c999569643b
child 263 7e8e995065c5
permissions -rw-r--r--
Merge: Geertjan's changes to the end of the chapter
jtulach@17
     1
/*
jtulach@17
     2
 * Žluťoučký kůň je naše hříbátko.
jtulach@17
     3
 * and open the template in the editor.
jtulach@17
     4
 */
jtulach@17
     5
jtulach@17
     6
package api;
jtulach@17
     7
jtulach@17
     8
import junit.framework.TestCase;
jtulach@17
     9
jtulach@17
    10
/**
jtulach@17
    11
 *
jtulach@17
    12
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jtulach@17
    13
 */
jtulach@17
    14
public class FactorialTest extends TestCase {
jtulach@17
    15
    
jtulach@17
    16
    public FactorialTest(String testName) {
jtulach@17
    17
        super(testName);
jtulach@17
    18
    }            
jtulach@17
    19
jtulach@17
    20
    @Override
jtulach@17
    21
    protected void setUp() throws Exception {
jtulach@17
    22
        super.setUp();
jtulach@17
    23
    }
jtulach@17
    24
jtulach@17
    25
    @Override
jtulach@17
    26
    protected void tearDown() throws Exception {
jtulach@17
    27
        super.tearDown();
jtulach@17
    28
    }
jtulach@17
    29
    
jtulach@17
    30
    public void testFactorial3() {
jtulach@17
    31
        assertEquals(6, Factorial.factorial(3));
jtulach@17
    32
    }
jtulach@17
    33
    
jtulach@20
    34
    public void testFactorial4() {
jtulach@20
    35
        assertEquals(24, Factorial.factorial(4));
jtulach@20
    36
    }
jtulach@20
    37
    
jtulach@17
    38
    public void testFactorial5() {
jtulach@17
    39
        assertEquals(120, Factorial.factorial(5));
jtulach@17
    40
    }
jtulach@17
    41
}