use of org.junit.runner.Description in project junit-dataprovider by TNG.
the class DataProviderFilterTest method testShouldRunShouldReturnFalseWhenDescriptionHavingSomeRandomCodeBetweenMethodNameAndClassButClassIsNotTheSame.
@Test
public void testShouldRunShouldReturnFalseWhenDescriptionHavingSomeRandomCodeBetweenMethodNameAndClassButClassIsNotTheSame() {
// Given:
doReturn("Method testMain(com.tngtech.Clazz)").when(filter).describe();
Description description = setupDescription(true, "testMain 8zBZ=(qzt)487(com.tngtech.OtherClazz)");
// When:
boolean result = underTest.shouldRun(description);
// Then:
assertThat(result).isFalse();
}
use of org.junit.runner.Description in project junit-dataprovider by TNG.
the class DataProviderFilterTest method testShouldRunShouldReturnTrueWhenDescriptionHaveAdditionalMethodIdxAndEqualsMethodNameAndClass.
@Test
public void testShouldRunShouldReturnTrueWhenDescriptionHaveAdditionalMethodIdxAndEqualsMethodNameAndClass() {
// Given:
doReturn("Method testMain(com.tngtech.Clazz)").when(filter).describe();
Description description = setupDescription(true, "testMain[1: ](com.tngtech.Clazz)");
// When:
boolean result = underTest.shouldRun(description);
// Then:
assertThat(result).isTrue();
}
use of org.junit.runner.Description in project junit-dataprovider by TNG.
the class DataProviderFilterTest method testShouldRunShouldReturnTrueForMatchingChildDescription.
@Test
public void testShouldRunShouldReturnTrueForMatchingChildDescription() {
// Given:
doReturn("Method testMain[1: ](com.tngtech.Clazz)").when(filter).describe();
Description description = setupDescription(false, "", setupDescription(true, "testMain[1: ](com.tngtech.Clazz)"));
// When:
boolean result = underTest.shouldRun(description);
// Then:
assertThat(result).isTrue();
}
use of org.junit.runner.Description in project junit-dataprovider by TNG.
the class DataProviderFilterTest method testShouldRunShouldReturnFalseWhenDescriptionDoesNotHaveExpectedMethodName.
@Test
public void testShouldRunShouldReturnFalseWhenDescriptionDoesNotHaveExpectedMethodName() {
// Given:
doReturn("Method testMain[1: ](com.tngtech.Clazz)").when(filter).describe();
Description description = setupDescription(true, "testOther[1: ](com.tngtech.Clazz)");
// When:
boolean result = underTest.shouldRun(description);
// Then:
assertThat(result).isFalse();
}
use of org.junit.runner.Description in project junit-dataprovider by TNG.
the class DataProviderFilterTest method testShouldRunShouldReturnTrueWhenDescriptionHaveAddtionalMethodIdxAndEqualsExcatly.
@Test
public void testShouldRunShouldReturnTrueWhenDescriptionHaveAddtionalMethodIdxAndEqualsExcatly() {
// Given:
doReturn("Method testMain[1: ](com.tngtech.Clazz)").when(filter).describe();
Description description = setupDescription(true, "testMain[1: ](com.tngtech.Clazz)");
// When:
boolean result = underTest.shouldRun(description);
// Then:
assertThat(result).isTrue();
}
Aggregations