-
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.
Fixed the issue that different formatted parameters having the same v…
…alue in all cases were collapsed to a single parameter (fixes #104)
- Loading branch information
Jan Schäfer
committed
Aug 26, 2015
1 parent
1b7c85f
commit 33eb875
Showing
5 changed files
with
91 additions
and
21 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
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
35 changes: 35 additions & 0 deletions
35
...xamples/src/test/java/com/tngtech/jgiven/examples/parameters/ParameterFormattingTest.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,35 @@ | ||
package com.tngtech.jgiven.examples.parameters; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import com.tngtech.java.junit.dataprovider.DataProvider; | ||
import com.tngtech.java.junit.dataprovider.DataProviderRunner; | ||
import com.tngtech.jgiven.annotation.Format; | ||
import com.tngtech.jgiven.format.BooleanFormatter; | ||
import com.tngtech.jgiven.junit.SimpleScenarioTest; | ||
|
||
@RunWith( DataProviderRunner.class ) | ||
public class ParameterFormattingTest extends SimpleScenarioTest<ParameterFormattingTest.TestSteps> { | ||
|
||
@Test | ||
@DataProvider( { | ||
"true, true", | ||
"false, false" | ||
} ) | ||
public void parameters_can_be_formatted( boolean onOff, boolean isOrIsNot ) { | ||
|
||
given().a_machine_that_is( onOff ); | ||
then().the_power_light_$_on( isOrIsNot ); | ||
|
||
} | ||
|
||
public static class TestSteps { | ||
|
||
public void a_machine_that_is( @Format( value = BooleanFormatter.class, args = { "on", "off" } ) boolean onOff ) {} | ||
|
||
public void the_power_light_$_on( @Format( value = BooleanFormatter.class, args = { "is", "is not" } ) boolean isOrIsNot ) {} | ||
|
||
} | ||
|
||
} |
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