package easy;

import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import java.util.stream.Stream;

import static org.assertj.core.api.Assertions.assertThat;

class GridGeneratorTest {

    @ParameterizedTest
    @MethodSource("testCasesProvider")
    void generate(int[] row, int[] col, int want) {
        GridGenerator gridGenerator = new GridGenerator();

        int got = gridGenerator.generate(row, col);

        assertThat(got).isEqualTo(want);
    }

    private static Stream<Arguments> testCasesProvider() {
        return Stream.of(
                Arguments.of(
                        new int[]{1, 0, 3, 4, 1},
                        new int[]{1, 4, 1, 0, 3},
                        579
                ),
                Arguments.of(
                        new int[]{9, 9, 9, 9, 9, 9, 9, 9, 9, 9},
                        new int[]{9, 9, 9, 9, 9, 9, 9, 9, 9, 9},
                        13163067
                ),
                Arguments.of(
                        new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0},
                        new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0},
                        0
                )
        );
    }
}