package pr2.vererbung.vararg_summe.test;

import org.junit.jupiter.api.Test;
import pr2.vererbung.vararg_summe.Summator;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class SummatorTest {

    @Test
    void testSum() {
        Summator s = new Summator();
        assertEquals(3, s.sum(1, 2));
        assertEquals(1, s.sum(-1, 2));
        assertEquals(6, s.sum(1, 2, 3));
        assertEquals(0, s.sum(1, 2, -3));
        assertEquals(10, s.sum(1, 2, 3, 4));
        assertEquals(2, s.sum(1, 2, 3, -4));
        assertEquals(15, s.sum(1, 2, 3, 4, 5));
        assertEquals(5, s.sum(1, 2, 3, 4, -5));
        assertEquals(36, s.sum(1, 2, 3, 4, 5, 6, 7, 8));
    }
}
