-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filter out duplicate parameter replacements (fixes #32)
- Loading branch information
Jan Schäfer
committed
Sep 28, 2014
1 parent
c79a18b
commit 840a5e4
Showing
5 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
jgiven-tests/src/test/java/com/tngtech/jgiven/report/analysis/ArgumentAnalyzerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.tngtech.jgiven.report.analysis; | ||
|
||
import org.junit.Test; | ||
|
||
import com.tngtech.jgiven.JGivenScenarioTest; | ||
import com.tngtech.jgiven.report.model.GivenReportModel; | ||
import com.tngtech.jgiven.report.model.ThenReportModel; | ||
import com.tngtech.jgiven.tags.Issue; | ||
|
||
public class ArgumentAnalyzerTest extends JGivenScenarioTest<GivenReportModel<?>, WhenAnalyzer<?>, ThenReportModel<?>> { | ||
|
||
@Test | ||
@Issue( "#32" ) | ||
public void multiple_parameter_usages_lead_to_one_parameter() { | ||
given().an_unanalyzed_report_model_with_one_scenario() | ||
.with().parameters( "param1" ) | ||
.and().the_scenario_has_$_cases( 2 ) | ||
.and().case_$_has_arguments( 1, "foo" ) | ||
.and().case_$_has_a_step_$_with_argument( 1, "some step", "foo" ) | ||
.and().case_$_has_a_step_$_with_argument( 1, "another step", "foo" ) | ||
.and().case_$_has_arguments( 2, "bar" ) | ||
.and().case_$_has_a_step_$_with_argument( 2, "some step", "bar" ) | ||
.and().case_$_has_a_step_$_with_argument( 2, "another step", "bar" ); | ||
when().the_argument_analyzer_is_executed(); | ||
then().the_scenario_has_derived_parameters( "param1" ) | ||
.and().case_$_has_derived_arguments( 1, "foo" ) | ||
.and().case_$_has_derived_arguments( 2, "bar" ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters