-
- All Implemented Interfaces:
-
org.junit.rules.TestRule
public class BaseTestCaseRule<InitData extends Object, Data extends Object> implements TestRuleThe base class for all parametrized test cases rules.
-
-
Constructor Summary
Constructors Constructor Description BaseTestCaseRule(Kaspresso.Builder kaspressoBuilder, String testClassName, Function1<Function1<InitData, Unit>, Data> dataProducer, List<MainSectionEnricher<Data>> mainSectionEnrichers)
-
Method Summary
Modifier and Type Method Description Statementapply(Statement base, Description description)final AfterTestSection<InitData, Data>before(String testName, Function1<BaseTestContext, Unit> actions)Starts the building a test, sets the BeforeTestSection actions and returns an existing instance of AfterTestSection to continue building a test. final TransformSection<Data>init(String testName, Function1<InitData, Unit> actions)Starts the building of a test from data initialization section. final Unitrun(String testName, Function1<TestContext<Data>, Unit> steps)Sets com.kaspersky.kaspresso.testcases.core.sections.MainTestSection steps, creates an instance of MainTestSection and runs it -
-
Method Detail
-
apply
Statement apply(Statement base, Description description)
-
before
final AfterTestSection<InitData, Data> before(String testName, Function1<BaseTestContext, Unit> actions)
Starts the building a test, sets the BeforeTestSection actions and returns an existing instance of AfterTestSection to continue building a test.
- Parameters:
testName- a name of the test.actions- actions to invoke in before test section.
-
init
final TransformSection<Data> init(String testName, Function1<InitData, Unit> actions)
Starts the building of a test from data initialization section. Sets com.kaspersky.kaspresso.testcases.core.sections.InitSection actions and returns an existing instance of MainTestSection to continue building a tests.
- Parameters:
testName- a name of the test.actions- actions to be wrapped and invoked before the test for data initialization
-
run
final Unit run(String testName, Function1<TestContext<Data>, Unit> steps)
Sets com.kaspersky.kaspresso.testcases.core.sections.MainTestSection steps, creates an instance of MainTestSection and runs it
- Parameters:
testName- a name of the test.steps- actions to invoke in main test section.
-
-
-
-