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
     1 /*
     2  * Žluťoučký kůň je naše hříbátko.
     3  * and open the template in the editor.
     4  */
     5 
     6 package api;
     7 
     8 import junit.framework.TestCase;
     9 
    10 /**
    11  *
    12  * @author Jaroslav Tulach <jtulach@netbeans.org>
    13  */
    14 public class ArithmeticaTest extends TestCase {
    15     
    16     public ArithmeticaTest(String testName) {
    17         super(testName);
    18     }            
    19 
    20     @Override
    21     protected void setUp() throws Exception {
    22         super.setUp();
    23     }
    24 
    25     @Override
    26     protected void tearDown() throws Exception {
    27         super.tearDown();
    28     }
    29 
    30     public void testSumTwo() {
    31         Arithmetica instance = new Arithmetica();
    32         assertEquals("+", 5, instance.sumTwo(3, 2));
    33     }
    34 
    35     public void testSumAll() {
    36         Arithmetica instance = new Arithmetica();
    37         assertEquals("+", 6, instance.sumAll(3, 2, 1));
    38     }
    39 
    40     public void testSumRange() {
    41         Arithmetica instance = new Arithmetica();
    42         assertEquals("+", 6, instance.sumRange(1, 3));
    43         assertEquals("10", 55, instance.sumRange(1, 10));
    44     }
    45 
    46 }