CalculatorSecondTest.java 783 Bytes
Newer Older
Dominik Vayhinger's avatar
Dominik Vayhinger committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

/**
 * Created by benno on 20.11.16.
 */
public class CalculatorSecondTest {

    private Calculator calculator = new Calculator();

    @Test
    public void add2() throws Exception {
        assertEquals(5, calculator.add(2, 3), 0.1);
    }

    @Test
    public void sub2() throws Exception {
        assertEquals(-1, calculator.sub(2, 3), 0.1);
    }

    @Test
    public void mult2() throws Exception {
        assertEquals(15, calculator.mult(5, 2), 0.1);
    }

    @Test
    public void div2() throws Exception {
        assertEquals(5, calculator.div(15, 3), 0.1);
    }

    @Test
    public void sum2() throws Exception {
        assertEquals(12, calculator.sum(3, 4, 5), 0.1);
    }

}