package com.translationdata.p000;

import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.translationdata.JUnitTests.FastTest;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.MatcherAssert.assertThat;


/** Strategy: Spring XML configuration. */
@Category(FastTest.class)
public class P001_UnitTest {
	String resourcePath;
	String fileName;
	final P001_Factory p001_Factory = P001_Factory.getFactory();
	
	@Test(timeout=1000)
	public void SumOfMultiplesOf3And5Below1000() {
		final int sumOfMultiples = p001_Factory.getMultiplesOf3And5().multiplesOf3And5(1_000);
		System.out.printf("P001: multiplesOf3And5(1000) = %s%n", sumOfMultiples);
		assertThat( "Incorrect sum of multiples of 3 or 5 below 1,000", sumOfMultiples, is(233168) );
	}
	
	@Test(timeout=1000)
	public void SumOfMultiplesOf3And5Below10_000() {
		final int sumOfMultiples = p001_Factory.getMultiplesOf3And5().multiplesOf3And5(10_000);
		System.out.printf("P001: multiplesOf3And5(10_000) = %s%n", sumOfMultiples);
		assertThat( "Incorrect sum of multiples of 3 or 5 below 10,000", sumOfMultiples, is(23331668) );
	}
}

@@ -28,16 +28,71 @@
 .p000;%0A%0A
+import java.util.Arrays;%0Aimport java.util.Collection;%0A%0A
 import o
@@ -156,16 +156,140 @@
 ategory;
+%0Aimport org.junit.runner.RunWith;%0Aimport org.junit.runners.Parameterized;%0Aimport org.junit.runners.Parameterized.Parameters;
 %0A%0Aimport
@@ -498,16 +498,46 @@
 .class)%0A
+@RunWith(Parameterized.class)%0A
 public c
@@ -597,16 +597,46 @@
 leName;%0A
+%09int upperLimit;%0A%09int result;%0A
 %09final P
@@ -697,334 +697,285 @@
 %09%0A%09@
-Test(timeout=1000)%0A%09public void SumOfMultiplesOf3And5Below1000() %7B%0A%09%09final int sumOfMultiples = p001_Factory.getMultiplesOf3And5().multiplesOf3And5(1_000);%0A%09%09System.out.printf(%22P001: multiplesOf3And5(1000) = %25s%25n%22, sumOfMultiples);%0A%09%09assertThat( %22Incorrect sum of multiples of 3 or 5 below 1,000%22, sumOfMultiples, is(233168) )
+Parameters%0A%09public static Collection%3CObject %5B%5D%3E getTestData() %7B%0A%09%09Object %5B%5D%5B%5D data = %7B%0A%09%09%09%7B1_000,%09 233168%7D,%0A%09%09%09%7B10_000, 23331668 %7D%0A%09%09%7D;%0A%09%09return Arrays.asList(data);%0A%09%7D%0A%09%0A%09public P001_UnitTest(int upperLimit, int result) %7B%0A%09%09this.upperLimit = upperLimit;%0A%09%09this.result = result
 ;%0A%09%7D
@@ -1039,18 +1039,16 @@
 5Below10
-_0
 00() %7B%0A%09
@@ -1127,22 +1127,26 @@
 Of3And5(
-10_000
+upperLimit
 );%0A%09%09Sys
@@ -1184,22 +1184,18 @@
 Of3And5(
-10_000
+%25d
 ) = %25s%25n
@@ -1196,16 +1196,40 @@
 = %25s%25n%22,
+ upperLimit, upperLimit,
  sumOfMu
@@ -1297,17 +1297,16 @@
  below 1
-0
 ,000%22, s
@@ -1323,24 +1323,22 @@
 les, is(
-23331668
+result
 ) );%0A%09%7D%0A

Use parameterized class