-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Gherkin and add ability to work with multiple languages #128
base: master
Are you sure you want to change the base?
Changes from 14 commits
a03abbd
e1a869b
b48a210
f2bc9ea
efcb472
55e9e52
e381b1d
bbb97c5
c2f5b6c
471217e
3849bf4
345a379
0405c97
65c6cd1
6eabfc0
c7f7e72
6623c47
32e012b
6a6a222
e78161f
3df192e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* text=auto | ||
appveyor.yml eol=lf | ||
.gitattributes eol=lf | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 1.0.{build} | ||
|
||
build_script: | ||
- cmd: >- | ||
dotnet build --configuration Release source\Xunit.Gherkin.Quick.sln | ||
|
||
dotnet pack --nologo --no-build --configuration Release source\Xunit.Gherkin.Quick.sln | ||
|
||
test_script: | ||
- cmd: >- | ||
dotnet test --nologo --no-restore --configuration Release source\Xunit.Gherkin.Quick.UnitTests\Xunit.Gherkin.Quick.UnitTests.csproj | ||
|
||
dotnet test --nologo --no-restore --configuration Release source\Xunit.Gherkin.Quick.ProjectConsumer\Xunit.Gherkin.Quick.ProjectConsumer.csproj | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. How is this different from what the appveyor does by default? |
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
namespace Xunit.Gherkin.Quick.ProjectConsumer.Addition | ||
namespace Xunit.Gherkin.Quick.ProjectConsumer.Emoji | ||
{ | ||
[FeatureFile("./Addition_ForMultipleUseCases/AddTwoNumbers.em.feature")] | ||
public class AddTwoNumbers : Addition.AddTwoNumbers { } | ||
} | ||
|
||
namespace Xunit.Gherkin.Quick.ProjectConsumer.Addition | ||
{ | ||
|
||
[FeatureFile("./Addition_ForMultipleUseCases/AddTwoNumbers.feature")] | ||
public sealed partial class AddTwoNumbers : Feature | ||
public partial class AddTwoNumbers : Feature | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why partial? |
||
{ | ||
|
||
private readonly Calculator _calculator = new Calculator(); | ||
|
||
[Given(@"I chose (-?\d+) as first number")] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
| ||
# language: em | ||
|
||
📚: AddTwoNumbers | ||
In order to learn Math | ||
As a regular human | ||
I want to add two numbers using Calculator | ||
|
||
@addition | ||
📕: Add two numbers | ||
😐 I chose 12 as first number | ||
😂 I chose 15 as second number | ||
🎬 I press add | ||
🙏 the result should be 27 on the screen | ||
|
||
@addition @bigaddition | ||
📕: Add two bigger numbers | ||
😐 I chose 120 as first number | ||
😂 I chose 150 as second number | ||
🎬 I press add | ||
🙏 the result should be 270 on the screen | ||
|
||
|
||
📕: Add various pairs of numbers | ||
😐 following table of 4 inputs and outputs: | ||
| Number 1 | Number 2 | Result | | ||
| 1 | 1 | 2 | | ||
| 10 | 20 | 30 | | ||
| 10 | 11 | 21 | | ||
| 111 | 222 | 333 | | ||
|
||
|
||
📖: Add two numbers with examples | ||
😐 I chose <a> as first number | ||
😂 I chose <b> as second number | ||
🎬 I press add | ||
🙏 the result should be <sum> on the screen | ||
|
||
@addition | ||
📓: | ||
| a | b | sum | | ||
| 0 | 1 | 1 | | ||
| 1 | 9 | 10 | | ||
|
||
📓: of bigger numbers | ||
| a | b | sum | | ||
| 99 | 1 | 100 | | ||
| 100 | 200 | 300 | | ||
|
||
@bigaddition | ||
📓: of large numbers | ||
| a | b | sum | | ||
| 999 | 1 | 1000 | | ||
| 9999 | 1 | 10000 | | ||
|
||
@ignore | ||
📓: of floating point numbers | ||
| a | b | sum | | ||
| 1.1 | 2.2 | 3.3 | | ||
|
||
@ignore | ||
📕: Add floating point numbers | ||
😐 I chose 1.11 as first number | ||
😂 I chose 2.22 as second number | ||
🎬 I press add | ||
🙏 the result should be 3.33 on the screen | ||
|
||
📕: Add numbers after seeing result | ||
😐 I chose 1 as first number | ||
😂 I chose 2 as second number | ||
😂 I pressed add | ||
😂 I saw 3 on the screen | ||
🎬 I choose 4 as first number | ||
😂 I choose 5 as second number | ||
😂 I press add | ||
🙏 the result should be 9 on the screen |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
| ||
# language: em | ||
|
||
📚: AddTwoNumbers Async | ||
In order to learn Math | ||
As a regular human | ||
I want to add two numbers using Calculator Asynchronously | ||
|
||
📕: Add two numbers | ||
😐 I chose 12 as first number | ||
😂 I chose 15 as second number | ||
🎬 I press add | ||
🙏 the result should be 27 on the screen |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
| ||
# language: em | ||
|
||
📚: Before/After Hooks | ||
As a BDD developer using Xunit.Gherkin.Quick | ||
I want to ensure that Before and After hooks work for Scenario | ||
So that I can write code that executes either before or after the Scenario | ||
|
||
📕: Scenario Before and After | ||
😐 first step executed | ||
😂 second step executed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you have added an emoji version for every test. I think that's too much for one feature, otherwise the codebase will grow exponentially and maintenance will be a headache. Please remove all these new feature files for emoji. Just create one feature file and one feature class for emoji version and that will prove the point. You can make that feature as advanced as you can, but keep everything in one feature. I will not be reviewing so many files for the same thing. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
| ||
# language: em | ||
|
||
📚: pass parameters | ||
In order to simplify use of regex | ||
I want to use cucumber expressions in feature steps | ||
|
||
|
||
📕: Pass positive integer to step function | ||
🎬 I pass the integer value 10 using cucumber expression | ||
🙏 the received integer value is 10 using regex | ||
|
||
|
||
📕: Pass negative integer to step function | ||
🎬 I pass the integer value -22 using cucumber expression | ||
🙏 the received integer value is -22 using regex | ||
|
||
|
||
📕: Pass integer zero to step function | ||
🎬 I pass the integer value 0 using cucumber expression | ||
🙏 the received integer value is 0 using regex | ||
|
||
|
||
📕: Pass positive float to step function | ||
🎬 I pass the float value 10.25 using cucumber expression | ||
🙏 the received float value is 10.25 using regex | ||
|
||
|
||
📕: Pass negative float to step function | ||
🎬 I pass the float value -20.25 using cucumber expression | ||
🙏 the received float value is -20.25 using regex | ||
|
||
|
||
📕: Pass float zero to step function | ||
🎬 I pass the float value 0 using cucumber expression | ||
🙏 the received float value is 0 using regex | ||
|
||
|
||
📕: Pass float zero dot zero to step function | ||
🎬 I pass the float value 0.0 using cucumber expression | ||
🙏 the received float value is 0.0 using regex | ||
|
||
|
||
📕: Pass word to step function | ||
🎬 I pass the word Max using cucumber expression | ||
🙏 the received word is Max using regex | ||
|
||
|
||
📕: Pass double quoted string to step function | ||
🎬 I pass the string "11 and A B C" using cucumber expression | ||
🙏 the received string is "11 and A B C" using regex | ||
|
||
|
||
📕: Pass double quoted string with single quotes to step function | ||
🎬 I pass the string "11 and 'A' or 'B' or 'C'" using cucumber expression | ||
🙏 the received string is "11 and 'A' or 'B' or 'C'" using regex | ||
|
||
|
||
📕: Pass empty string to step function | ||
🎬 I pass the string "" using cucumber expression | ||
🙏 the received string is "" using regex | ||
|
||
|
||
📕: Pass single quoted string to step function | ||
🎬 I pass the string '11 and A B C' using cucumber expression | ||
🙏 the received string is "11 and A B C" using regex | ||
|
||
|
||
📕: Pass single quoted string with double quotes to step function | ||
🎬 I pass the string '11 and "A" and "B" and "C"' using cucumber expression | ||
🙏 the received string is '11 and "A" and "B" and "C"' using single quotes regex | ||
|
||
|
||
📕: Pass single quoted empty string to step function | ||
🎬 I pass the string '' using cucumber expression | ||
🙏 the received string is "" using regex | ||
|
||
|
||
📕: Pass anything to step function | ||
🎬 I say Quasimodo the Grand | ||
🙏 it is the same as "Quasimodo the Grand" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
| ||
# language: em | ||
|
||
📚: Text Builder | ||
In order to manipulate text | ||
As a text nerd | ||
I need to have a Text Builder mechanism | ||
|
||
📕: Replacing words in text | ||
😐 I have a text like this: | ||
""" | ||
Hello word | ||
|
||
The word is beautiful. | ||
Isn't it? | ||
|
||
I'm coming word | ||
""" | ||
🎬 I replace 'word' with 'world' | ||
🙏 I should have text like this: | ||
""" | ||
Hello world | ||
|
||
The world is beautiful. | ||
Isn't it? | ||
|
||
I'm coming world | ||
""" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
| ||
# language: em | ||
|
||
📚: 😐 🎬 Then | ||
In order to use 😐 🎬 🙏 and other attributes | ||
As a Gherkin enthusiast | ||
I want to ensure they map to methods | ||
|
||
📕: Ensure order of steps | ||
😐 Sample text for Given | ||
😂 Sample text for And after Given | ||
😔 Sample text for But after Given | ||
🎬 Sample text for When | ||
😂 Sample text for And after When | ||
😔 Sample text for But after When | ||
🙏 Sample text for Then | ||
😂 Sample text for And after Then | ||
😔 Sample text for But after Then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to check if these changes are necessary.