package com.github.mateuszwenus.fizz_buzz_kata;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import org.junit.Test;
import org.junit.runner.RunWith;

import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import junitparams.naming.TestCaseName;

@RunWith(JUnitParamsRunner.class)
public class FizzBuzzParametrisedTest {

	private FizzBuzz fizzBuzz = new FizzBuzz();

	@Test
	@Parameters({ "1,1", "2,2", "3,Fizz", "6,Fizz", "5,Buzz", "10,Buzz", "15,FizzBuzz" })
	@TestCaseName("FizzBuzz({0}) = {1}")
	public void shouldPrintCorrectResult(int number, String expectedResult) {
		// when
		String result = fizzBuzz.print(number);
		// then
		assertThat(result, is(expectedResult));
	}
}

@@ -128,16 +128,53 @@
 ertThat;
+%0Aimport static org.junit.Assert.fail;
 %0A%0Aimport
@@ -455,16 +455,303 @@
 uzz();%0A%0A
+%09@Test%0A%09@Parameters(%7B %220%22, %22-1%22, %22-10%22 %7D)%0A%09@TestCaseName(%22should throw exception for %7B0%7D%22)%0A%09public void shouldThrowExceptionWhenNumberIsNotPositive(int number) %7B%0A%09%09try %7B%0A%09%09%09// when%0A%09%09%09fizzBuzz.print(number);%0A%09%09%09fail();%0A%09%09%7D catch (IllegalArgumentException expected) %7B%0A%09%09%09// then%0A%09%09%7D%0A%09%7D%0A%09%0A
 %09@Test%0A%09

test for nonpositive numbers