/***
 * Excerpted from "Domain-Driven Design Using Naked Objects",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/dhnako for more book information.
***/
package com.pragprog.dhnako.carserv.fitnesse;
import java.io.File;
import java.util.Collection;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import com.neuri.trinidad.JUnitHelper;
import com.neuri.trinidad.TestRunner;
import com.neuri.trinidad.fitnesserunner.FitNesseRepository;
import com.neuri.trinidad.fitnesserunner.FitTestEngine;

import java.util.Arrays;

@RunWith(Parameterized.class)
public class InteractionFixtureTest {

	@Parameters
	public static Collection<Object[]> data() {
		return Arrays.asList(new Object[][]{
				
//				{"ExampleStorySuite.TestRunViewer"},
			
//				{"ExampleStorySuite.DebuggingAndDiagnostics"},
		});
	}
	
	private final String testPage;
	private TestRunner testRunner;
	private JUnitHelper helper;
	
	public InteractionFixtureTest(String testPage) {
		this.testPage = testPage;
	}

	@Before
	public void initHelper() throws Exception {
		String fitnesseTempDir = new File(System.getProperty("java.io.tmpdir"),
				"fitnesse").getAbsolutePath();
		testRunner = new TestRunner(
				new FitNesseRepository("src/main/resources"),
				new FitTestEngine(), fitnesseTempDir);
		helper = new JUnitHelper(testRunner);
	}

	@Test
	public void runFitnesseTest() throws Exception {
		helper.assertTestPasses(testPage);
	}


}