package de.gurkenlabs.litiengine;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

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

public class GameRandomTests {

    private GameRandom gameRandom;
    @BeforeEach
    public void initSeed(){
        gameRandom = new GameRandom();
        gameRandom.setSeed(1337);
    }

    @Test
    public void testNextIntMinEqualsBound(){
        // arrange
        double result = this.gameRandom.nextInt(42, 42);

        // act, assert
        assertEquals(42, result);
    }

    @Test
    public void testNextIntMinGreaterThanBound(){
        // arrange, act, assert
        assertThrows(IllegalArgumentException.class, () -> this.gameRandom.nextInt(42, 40));
    }

    @Test
    public void testNextIntMinSmallerThanBound(){
        // arrange
        double result = this.gameRandom.nextInt(40, 42);

        // act, assert
        assertEquals(41, result);
    }
}

@@ -1006,11 +1006,440 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void chooseStringArray_ThrowsOnNull() %7B%0A        // act, assert%0A        assertThrows(IllegalArgumentException.class, () -%3E gameRandom.choose((String%5B%5D) null));%0A    %7D%0A%0A    @Test%0A    public void chooseStringArray_ThrowsOnEmpty() %7B%0A        // arrange%0A        final String%5B%5D arr = new String%5B%5D %7B%7D;%0A%0A        // act, assert%0A        assertThrows(IllegalArgumentException.class, () -%3E gameRandom.choose(arr));%0A    %7D
 %0A%7D%0A

raise statement coverage for choose(String...) to 100%