com.tngtech.jgiven.tests.assumptions.TestNgAssumptionTestScenarios Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jgiven-tests Show documentation
Show all versions of jgiven-tests Show documentation
JGiven Tests - Contains BDD tests for JGiven written in JGiven
The newest version!
package com.tngtech.jgiven.tests.assumptions;
import com.tngtech.jgiven.annotation.ScenarioStage;
import com.tngtech.jgiven.testng.ScenarioTestListener;
import com.tngtech.jgiven.tests.GivenTestStage;
import com.tngtech.jgiven.tests.ScenarioTestForTesting;
import com.tngtech.jgiven.tests.ThenTestStage;
import com.tngtech.jgiven.tests.WhenTestStage;
import org.testng.SkipException;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
@Listeners(ScenarioTestListener.class)
public class TestNgAssumptionTestScenarios {
@ScenarioStage
GivenTestStage givenTestStage;
@Test
public void test_with_failing_assumption() {
throw new SkipException("Fail on purpose");
}
@Test
public void test_with_failing_assumption_in_second_stage() {
givenTestStage.given().nothing().and()
.a_failed_testng_assumption();
}
@Test
public void test_with_failing_assumption_in_stage() {
givenTestStage.given().a_failed_testng_assumption().and()
.nothing();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy