samples/composition/src-test/api/ArithmeticaTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 10:04:51 +0200
changeset 209 1c999569643b
parent 206 b1f279a7ec46
child 210 acf2c31e22d4
permissions -rw-r--r--
to the end of daily_life
     1 package api;
     2 
     3 import junit.framework.TestCase;
     4 
     5 /**
     6  *
     7  * @author Jaroslav Tulach <jtulach@netbeans.org>
     8  */
     9 public class ArithmeticaTest extends TestCase {
    10     
    11     public ArithmeticaTest(String testName) {
    12         super(testName);
    13     }            
    14 
    15     @Override
    16     protected void setUp() throws Exception {
    17         super.setUp();
    18     }
    19 
    20     @Override
    21     protected void tearDown() throws Exception {
    22         super.tearDown();
    23     }
    24 
    25     //BEGIN: design.composition.arith.test
    26     public void testSumTwo() {
    27         Arithmetica instance = new Arithmetica();
    28         assertEquals("+", 5, instance.sumTwo(3, 2));
    29     }
    30 
    31     public void testSumAll() {
    32         Arithmetica instance = new Arithmetica();
    33         assertEquals("+", 6, instance.sumAll(3, 2, 1));
    34     }
    35 
    36     public void testSumRange() {
    37         Arithmetica instance = new Arithmetica();
    38         assertEquals("+", 6, instance.sumRange(1, 3));
    39         assertEquals("10", 55, instance.sumRange(1, 10));
    40     }
    41     //END: design.composition.arith.test
    42 
    43 }