samples/composition/src-test/api/ArithmeticaTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:51:04 +0200
changeset 17 af005434d27f
child 22 7b36dbc9df32
permissions -rw-r--r--
Converting to ant freeform script as it allows to demonstrate the amoeba effect
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 ArithmeticaTest extends TestCase {
jtulach@17
    15
    
jtulach@17
    16
    public ArithmeticaTest(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 testSumTwo() {
jtulach@17
    31
        Arithmetica instance = new Arithmetica();
jtulach@17
    32
        assertEquals("+", 5, instance.sumTwo(3, 2));
jtulach@17
    33
    }
jtulach@17
    34
jtulach@17
    35
    public void testSumAll() {
jtulach@17
    36
        Arithmetica instance = new Arithmetica();
jtulach@17
    37
        assertEquals("+", 6, instance.sumAll(3, 2, 1));
jtulach@17
    38
    }
jtulach@17
    39
jtulach@17
    40
    public void testSumRange() {
jtulach@17
    41
        Arithmetica instance = new Arithmetica();
jtulach@17
    42
        assertEquals("+", 6, instance.sumRange(1, 3));
jtulach@17
    43
        assertEquals("10", 55, instance.sumRange(1, 10));
jtulach@17
    44
    }
jtulach@17
    45
jtulach@17
    46
}