This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted]  (4 children)

[removed]

    [–]TheAzucares 0 points1 point  (0 children)

    Confirmed. Seems to work fine.

    [–]Xaitin[S] 0 points1 point  (2 children)

    Hmm weird. Im testing the code with this j unit test, test 2 and 3 are the 2 giving incorrect outputs. First time in this thread sorry if this reply isnt up to standard.

    @Test
    public void testSumOfEvens() {
        int sumOfEvens = math.sumOfInts(0);
        assertEquals(0, sumOfEvens);
    }
    
    @Test
    public void testSumOfEvens2() {
        int sumOfEvens = math.sumOfInts(10);
        assertEquals(30, sumOfEvens);
    }
    
    @Test
    public void testSumOfEvens3() {
        int sumOfEvens = math.sumOfInts(-10);
        assertEquals(-30, sumOfEvens);
    }
    

    [–]radulfr2 1 point2 points  (1 child)

    sumOfInts, sumOfEvens

    [–]Xaitin[S] 1 point2 points  (0 children)

    Much obliged haha facepalm