From c8175971b7466a071b481ff5dd86f6f885698ae9 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Wed, 4 Jan 2023 16:50:03 -0700 Subject: [PATCH] added gerken --- .vscode/extensions.json | 5 ++ .vscode/settings.json | 6 ++ Management.Gherkin/.gitignore | 1 + Management.Gherkin/Drivers/Driver.cs | 9 +++ .../Features/Calculator.feature | 13 +++++ Management.Gherkin/Hooks/Hook.cs | 11 ++++ Management.Gherkin/Management.Gherkin.csproj | 16 +++++ .../Steps/CalculatorStepDefinitions.cs | 58 +++++++++++++++++++ Management/Features/Calendar/CalendarMonth.cs | 4 ++ README.md | 7 ++- 10 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 Management.Gherkin/.gitignore create mode 100644 Management.Gherkin/Drivers/Driver.cs create mode 100644 Management.Gherkin/Features/Calculator.feature create mode 100644 Management.Gherkin/Hooks/Hook.cs create mode 100644 Management.Gherkin/Management.Gherkin.csproj create mode 100644 Management.Gherkin/Steps/CalculatorStepDefinitions.cs create mode 100644 Management/Features/Calendar/CalendarMonth.cs diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..aba32f6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "alexkrechik.cucumberautocomplete" + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5c9dc78 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cucumberautocomplete.steps": [ + "./Management.Gherkin/**/*.cs" + + ] +} \ No newline at end of file diff --git a/Management.Gherkin/.gitignore b/Management.Gherkin/.gitignore new file mode 100644 index 0000000..ac27860 --- /dev/null +++ b/Management.Gherkin/.gitignore @@ -0,0 +1 @@ +*.feature.cs diff --git a/Management.Gherkin/Drivers/Driver.cs b/Management.Gherkin/Drivers/Driver.cs new file mode 100644 index 0000000..d0a3a93 --- /dev/null +++ b/Management.Gherkin/Drivers/Driver.cs @@ -0,0 +1,9 @@ +using System; + +namespace Management.Gherkin.Drivers +{ + public class Driver + { + + } +} diff --git a/Management.Gherkin/Features/Calculator.feature b/Management.Gherkin/Features/Calculator.feature new file mode 100644 index 0000000..3dadd75 --- /dev/null +++ b/Management.Gherkin/Features/Calculator.feature @@ -0,0 +1,13 @@ +Feature: Calculator +![Calculator](https://specflow.org/wp-content/uploads/2020/09/calculator.png) +Simple calculator for adding **two** numbers + +Link to a feature: [Calculator]($projectname$/Features/Calculator.feature) +***Further read***: **[Learn more about how to generate Living Documentation](https://docs.specflow.org/projects/specflow-livingdoc/en/latest/LivingDocGenerator/Generating-Documentation.html)** + +@mytag +Scenario: Add two numbers + Given the first number is 50 + And the second number is 70 + When the two numbers are added + Then the result should be 120 diff --git a/Management.Gherkin/Hooks/Hook.cs b/Management.Gherkin/Hooks/Hook.cs new file mode 100644 index 0000000..0fe82f4 --- /dev/null +++ b/Management.Gherkin/Hooks/Hook.cs @@ -0,0 +1,11 @@ +using System; +using TechTalk.SpecFlow; + +namespace Management.Gherkin.Hooks +{ + [Binding] + public class Hooks + { + + } +} diff --git a/Management.Gherkin/Management.Gherkin.csproj b/Management.Gherkin/Management.Gherkin.csproj new file mode 100644 index 0000000..b9c0ef8 --- /dev/null +++ b/Management.Gherkin/Management.Gherkin.csproj @@ -0,0 +1,16 @@ + + + + net7.0 + + + + + + + + + + + + diff --git a/Management.Gherkin/Steps/CalculatorStepDefinitions.cs b/Management.Gherkin/Steps/CalculatorStepDefinitions.cs new file mode 100644 index 0000000..bafba90 --- /dev/null +++ b/Management.Gherkin/Steps/CalculatorStepDefinitions.cs @@ -0,0 +1,58 @@ +using TechTalk.SpecFlow; + +namespace Management.Gherkin.Steps +{ + [Binding] + public sealed class CalculatorStepDefinitions + { + + // For additional details on SpecFlow step definitions see https://go.specflow.org/doc-stepdef + + private readonly ScenarioContext _scenarioContext; + + public CalculatorStepDefinitions(ScenarioContext scenarioContext) + { + _scenarioContext = scenarioContext; + } + + [Given("the first number is (.*)")] + public void GivenTheFirstNumberIs(int number) + { + //TODO: implement arrange (precondition) logic + // For storing and retrieving scenario-specific data see https://go.specflow.org/doc-sharingdata + // To use the multiline text or the table argument of the scenario, + // additional string/Table parameters can be defined on the step definition + // method. + + _scenarioContext.Pending(); + } + + [Given("the second number is (.*)")] + public void GivenTheSecondNumberIs(int number) + { + //TODO: implement arrange (precondition) logic + // For storing and retrieving scenario-specific data see https://go.specflow.org/doc-sharingdata + // To use the multiline text or the table argument of the scenario, + // additional string/Table parameters can be defined on the step definition + // method. + + _scenarioContext.Pending(); + } + + [When("the two numbers are added")] + public void WhenTheTwoNumbersAreAdded() + { + //TODO: implement act (action) logic + + _scenarioContext.Pending(); + } + + [Then("the result should be (.*)")] + public void ThenTheResultShouldBe(int result) + { + //TODO: implement assert (verification) logic + + _scenarioContext.Pending(); + } + } +} diff --git a/Management/Features/Calendar/CalendarMonth.cs b/Management/Features/Calendar/CalendarMonth.cs new file mode 100644 index 0000000..a6b29c2 --- /dev/null +++ b/Management/Features/Calendar/CalendarMonth.cs @@ -0,0 +1,4 @@ +public class CalendarMonth +{ + +} \ No newline at end of file diff --git a/README.md b/README.md index 8a2edd6..66864b3 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -# canvasManagement \ No newline at end of file +# canvasManagement + + +install specflow template `dotnet new install Specflow.Templates.DotNet` + +view templates with `dotnet new -l` \ No newline at end of file