samples/consistency/src-test/api/ArithmeticaTest.java
changeset 26 913d1d0a7bdf
child 27 699c5a4f0fab
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/consistency/src-test/api/ArithmeticaTest.java	Sat Jun 14 09:51:12 2008 +0200
     1.3 @@ -0,0 +1,43 @@
     1.4 +package api;
     1.5 +
     1.6 +import junit.framework.TestCase;
     1.7 +
     1.8 +/**
     1.9 + *
    1.10 + * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.11 + */
    1.12 +public class ArithmeticaTest extends TestCase {
    1.13 +    
    1.14 +    public ArithmeticaTest(String testName) {
    1.15 +        super(testName);
    1.16 +    }            
    1.17 +
    1.18 +    @Override
    1.19 +    protected void setUp() throws Exception {
    1.20 +        super.setUp();
    1.21 +    }
    1.22 +
    1.23 +    @Override
    1.24 +    protected void tearDown() throws Exception {
    1.25 +        super.tearDown();
    1.26 +    }
    1.27 +
    1.28 +    //BEGIN: design.composition.arith.test
    1.29 +    public void testSumTwo() {
    1.30 +        Arithmetica instance = new Arithmetica();
    1.31 +        assertEquals("+", 5, instance.sumTwo(3, 2));
    1.32 +    }
    1.33 +
    1.34 +    public void testSumAll() {
    1.35 +        Arithmetica instance = new Arithmetica();
    1.36 +        assertEquals("+", 6, instance.sumAll(3, 2, 1));
    1.37 +    }
    1.38 +
    1.39 +    public void testSumRange() {
    1.40 +        Arithmetica instance = new Arithmetica();
    1.41 +        assertEquals("+", 6, instance.sumRange(1, 3));
    1.42 +        assertEquals("10", 55, instance.sumRange(1, 10));
    1.43 +    }
    1.44 +    //END: design.composition.arith.test
    1.45 +
    1.46 +}