samples/sidemeanings/test/org/apidesign/sidemeanings/math/ArithmeticaTest.java
changeset 325 4553c2885ce6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/samples/sidemeanings/test/org/apidesign/sidemeanings/math/ArithmeticaTest.java	Fri Mar 27 20:30:39 2009 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/*
     1.5 + * To change this template, choose Tools | Templates
     1.6 + * and open the template in the editor.
     1.7 + */
     1.8 +
     1.9 +package org.apidesign.sidemeanings.math;
    1.10 +
    1.11 +import org.junit.Before;
    1.12 +import org.junit.Test;
    1.13 +import static org.junit.Assert.*;
    1.14 +
    1.15 +/**
    1.16 + *
    1.17 + * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.18 + */
    1.19 +public class ArithmeticaTest {
    1.20 +    Arithmetica instance;
    1.21 +
    1.22 +    public ArithmeticaTest() {
    1.23 +    }
    1.24 +
    1.25 +    @Before
    1.26 +    public void setUp() {
    1.27 +        instance = Arithmetica.create();
    1.28 +    }
    1.29 +
    1.30 +    @Test
    1.31 +    public void testSumTwo() {
    1.32 +        assertEquals("+", 5, instance.sumTwo(3, 2));
    1.33 +    }
    1.34 +
    1.35 +    @Test
    1.36 +    public void testSumAll() {
    1.37 +        assertEquals("+", 6, instance.sumAll(3, 2, 1));
    1.38 +    }
    1.39 +
    1.40 +    @Test
    1.41 +    public void testSumRange() {
    1.42 +        assertEquals("1+2+3=6", 6, instance.sumRange(1, 3));
    1.43 +        assertEquals("sum(1,10)=55", 55, instance.sumRange(1, 10));
    1.44 +        assertEquals("sum(1,1)=1", 1, instance.sumRange(1, 1));
    1.45 +        assertEquals("sum(10,1)=55", 55, instance.sumRange(10, 1));
    1.46 +    }
    1.47 +}
    1.48 \ No newline at end of file