package org.junit.tests.experimental.theories;

import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.junit.experimental.theories.DataPoint;
import org.junit.experimental.theories.Theories;
import org.junit.experimental.theories.Theory;
import org.junit.runner.JUnitCore;
import org.junit.runner.Request;
import org.junit.runner.Result;
import org.junit.runner.RunWith;
import org.junit.runner.Runner;
import org.junit.runners.model.InitializationError;

@RunWith(Theories.class)
public class AssumingInTheoriesTest {

	@Test
	public void noTheoryAnnotationMeansAssumeShouldIgnore(){
		Assume.assumeTrue(false);
	}

	@Test
	public void theoryMeansOnlyAssumeShouldFail() throws InitializationError{
		
		JUnitCore junitRunner = new JUnitCore();
		Runner theoryRunner = new Theories(TheoryWithNoUnassumedParameters.class);
		Request request = Request.runner(theoryRunner);
		Result result = junitRunner.run(request);
		Assert.assertEquals("A theory with no valid parameters did not fail.", 1, result.getFailureCount());
		
	}

	/**
	 * Simple class that SHOULD fail because no parameters are met.
	 */
	public static class TheoryWithNoUnassumedParameters{
		
		@DataPoint 
		public final static boolean FALSE = false;
		
		@Theory
		public void theoryWithNoUnassumedParameters(boolean value)
		{
			Assume.assumeTrue(value);
		}
	}

}

@@ -605,18 +605,19 @@
 Ignore()
+ 
 %7B%0A
-
 %09%09Assume
@@ -720,21 +720,19 @@
 ionError
+ 
 %7B%0A
-%09%09%0A
 %09%09JUnitC
@@ -963,59 +963,8 @@
 als(
-%22A theory with no valid parameters did not fail.%22, 
 1, r
@@ -989,19 +989,16 @@
 unt());%0A
-%09%09%0A
 %09%7D%0A%0A%09/**
@@ -1120,16 +1120,17 @@
 rameters
+ 
 %7B%0A%09%09%0A%09%09@
@@ -1258,19 +1258,17 @@
 n value)
-%0A%09%09
+ 
 %7B%0A%09%09%09Ass

Make stylistic changes