From: David S. <ds...@us...> - 2007-07-12 17:08:34
|
Update of /cvsroot/junit/junit/src/org/junit/experimental/test/assertion In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26134/src/org/junit/experimental/test/assertion Added Files: AssumptionViolatedExceptionTest.java Log Message: Re-organize theory packages --- NEW FILE: AssumptionViolatedExceptionTest.java --- package org.junit.experimental.test.assertion; import static org.junit.matchers.StringContains.containsString; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import org.hamcrest.Matcher; import org.hamcrest.StringDescription; import org.junit.Test; import org.junit.Assume.AssumptionViolatedException; import org.junit.experimental.theories.methods.api.Theory; import org.junit.experimental.theories.runner.api.Theories; import org.junit.runner.RunWith; @RunWith(Theories.class) public class AssumptionViolatedExceptionTest { public static Object TWO= 2; public static Matcher<?> IS_THREE= is(3); @Theory public void toStringIsUseful(Object actual, Matcher<?> matcher) { assertThat(new AssumptionViolatedException(actual, matcher).toString(), containsString(matcher.toString())); } @Test public void AssumptionViolatedExceptionDescribesItself() { AssumptionViolatedException e= new AssumptionViolatedException(3, is(2)); assertThat(StringDescription.asString(e), is("got: <3>, expected: is <2>")); } } |