Initial commit
This commit is contained in:
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
RealLifeUnitTest/obj/*
|
||||
RealLifeUnitTest/bin/*
|
||||
29
.vs/RealLifeUnitTest/xs/UserPrefs.xml
Normal file
29
.vs/RealLifeUnitTest/xs/UserPrefs.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<Properties StartupConfiguration="{CA10CC55-BF19-4A14-A41F-685702445BE0}|Default">
|
||||
<MonoDevelop.Ide.ItemProperties.RealLifeUnitTest PreferredExecutionTarget="MonoDevelop.Default" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="RealLifeUnitTest/FeatureSteps/exampleStep.cs">
|
||||
<Files>
|
||||
<File FileName="RealLifeUnitTest/Features/example.feature" Line="11" Column="45" />
|
||||
<File FileName="RealLifeUnitTest/FeatureSteps/exampleStep.cs" Line="1" Column="1" />
|
||||
</Files>
|
||||
<Pads>
|
||||
<Pad Id="ProjectPad">
|
||||
<State name="__root__">
|
||||
<Node name="RealLifeUnitTest" expanded="True">
|
||||
<Node name="RealLifeUnitTest" expanded="True">
|
||||
<Node name="Features" expanded="True" />
|
||||
<Node name="FeatureSteps" expanded="True">
|
||||
<Node name="exampleStep.cs" selected="True" />
|
||||
</Node>
|
||||
</Node>
|
||||
</Node>
|
||||
</State>
|
||||
</Pad>
|
||||
</Pads>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<MultiItemStartupConfigurations />
|
||||
</Properties>
|
||||
File diff suppressed because one or more lines are too long
0
.vs/RealLifeUnitTest/xs/sqlite3/db.lock
Normal file
0
.vs/RealLifeUnitTest/xs/sqlite3/db.lock
Normal file
BIN
.vs/RealLifeUnitTest/xs/sqlite3/storage.ide
Normal file
BIN
.vs/RealLifeUnitTest/xs/sqlite3/storage.ide
Normal file
Binary file not shown.
BIN
.vs/RealLifeUnitTest/xs/sqlite3/storage.ide-shm
Normal file
BIN
.vs/RealLifeUnitTest/xs/sqlite3/storage.ide-shm
Normal file
Binary file not shown.
BIN
.vs/RealLifeUnitTest/xs/sqlite3/storage.ide-wal
Normal file
BIN
.vs/RealLifeUnitTest/xs/sqlite3/storage.ide-wal
Normal file
Binary file not shown.
17
RealLifeUnitTest.sln
Normal file
17
RealLifeUnitTest.sln
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RealLifeUnitTest", "RealLifeUnitTest\RealLifeUnitTest.csproj", "{CA10CC55-BF19-4A14-A41F-685702445BE0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CA10CC55-BF19-4A14-A41F-685702445BE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CA10CC55-BF19-4A14-A41F-685702445BE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CA10CC55-BF19-4A14-A41F-685702445BE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CA10CC55-BF19-4A14-A41F-685702445BE0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
RealLifeUnitTest/.DS_Store
vendored
Normal file
BIN
RealLifeUnitTest/.DS_Store
vendored
Normal file
Binary file not shown.
88
RealLifeUnitTest/.gitignore
vendored
Normal file
88
RealLifeUnitTest/.gitignore
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
44
RealLifeUnitTest/FeatureSteps/exampleStep.cs
Normal file
44
RealLifeUnitTest/FeatureSteps/exampleStep.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using FluentAssertions;
|
||||
using TechTalk.SpecFlow;
|
||||
|
||||
namespace RealLifeUnitTest.FeatureSteps
|
||||
{
|
||||
[Binding]
|
||||
public class exampleStep
|
||||
{
|
||||
[Given("I have entered (.*) into the calculator")]
|
||||
public void GivenIHaveEnteredSomethingIntoTheCalculator(int number)
|
||||
{
|
||||
// TODO: implement arrange (recondition) logic
|
||||
// For storing and retrieving scenario-specific data,
|
||||
// the instance fields of the class or the
|
||||
// ScenarioContext.Current
|
||||
// collection can be used.
|
||||
// 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.Current.Pending();
|
||||
}
|
||||
|
||||
[When("I press add")]
|
||||
public void WhenIPressAdd()
|
||||
{
|
||||
// TODO: implement act (action) logic
|
||||
|
||||
//ScenarioContext.Current.Pending();
|
||||
}
|
||||
|
||||
[Then("the result should be (.*) on the screen")]
|
||||
public void ThenTheResultShouldBe(int result)
|
||||
{
|
||||
// TODO: implement assert (verification) logic
|
||||
|
||||
//ScenarioContext.Current.Pending();
|
||||
bool balls;
|
||||
balls = true;
|
||||
balls.Should().BeTrue();
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
RealLifeUnitTest/Features/.DS_Store
vendored
Normal file
BIN
RealLifeUnitTest/Features/.DS_Store
vendored
Normal file
Binary file not shown.
11
RealLifeUnitTest/Features/example.feature
Normal file
11
RealLifeUnitTest/Features/example.feature
Normal file
@@ -0,0 +1,11 @@
|
||||
Feature: Addition
|
||||
In order to avoid silly mistakes
|
||||
As a math idiot
|
||||
I want to be told the sum of two numbers
|
||||
|
||||
@mytag
|
||||
Scenario: Add two numbers
|
||||
Given I have entered 50 into the calculator
|
||||
And I have entered 70 into the calculator
|
||||
When I press add
|
||||
Then the result should be 120 on the screen
|
||||
124
RealLifeUnitTest/Features/example.feature.cs
generated
Normal file
124
RealLifeUnitTest/Features/example.feature.cs
generated
Normal file
@@ -0,0 +1,124 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:3.1.0.0
|
||||
// SpecFlow Generator Version:3.1.0.0
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
// ------------------------------------------------------------------------------
|
||||
#region Designer generated code
|
||||
#pragma warning disable
|
||||
namespace RealLifeUnitTest.Features
|
||||
{
|
||||
using TechTalk.SpecFlow;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "3.1.0.0")]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[NUnit.Framework.TestFixtureAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Addition")]
|
||||
public partial class AdditionFeature
|
||||
{
|
||||
|
||||
private TechTalk.SpecFlow.ITestRunner testRunner;
|
||||
|
||||
private string[] _featureTags = ((string[])(null));
|
||||
|
||||
#line 1 "example.feature"
|
||||
#line hidden
|
||||
|
||||
[NUnit.Framework.OneTimeSetUpAttribute()]
|
||||
public virtual void FeatureSetup()
|
||||
{
|
||||
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
|
||||
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Addition", "\tIn order to avoid silly mistakes\n\tAs a math idiot\n\tI want to be told the sum of " +
|
||||
"two numbers", ProgrammingLanguage.CSharp, ((string[])(null)));
|
||||
testRunner.OnFeatureStart(featureInfo);
|
||||
}
|
||||
|
||||
[NUnit.Framework.OneTimeTearDownAttribute()]
|
||||
public virtual void FeatureTearDown()
|
||||
{
|
||||
testRunner.OnFeatureEnd();
|
||||
testRunner = null;
|
||||
}
|
||||
|
||||
[NUnit.Framework.SetUpAttribute()]
|
||||
public virtual void TestInitialize()
|
||||
{
|
||||
}
|
||||
|
||||
[NUnit.Framework.TearDownAttribute()]
|
||||
public virtual void TestTearDown()
|
||||
{
|
||||
testRunner.OnScenarioEnd();
|
||||
}
|
||||
|
||||
public virtual void ScenarioInitialize(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
|
||||
{
|
||||
testRunner.OnScenarioInitialize(scenarioInfo);
|
||||
testRunner.ScenarioContext.ScenarioContainer.RegisterInstanceAs<NUnit.Framework.TestContext>(NUnit.Framework.TestContext.CurrentContext);
|
||||
}
|
||||
|
||||
public virtual void ScenarioStart()
|
||||
{
|
||||
testRunner.OnScenarioStart();
|
||||
}
|
||||
|
||||
public virtual void ScenarioCleanup()
|
||||
{
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
|
||||
[NUnit.Framework.TestAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Add two numbers")]
|
||||
[NUnit.Framework.CategoryAttribute("mytag")]
|
||||
public virtual void AddTwoNumbers()
|
||||
{
|
||||
string[] tagsOfScenario = new string[] {
|
||||
"mytag"};
|
||||
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Add two numbers", null, new string[] {
|
||||
"mytag"});
|
||||
#line 7
|
||||
this.ScenarioInitialize(scenarioInfo);
|
||||
#line hidden
|
||||
bool isScenarioIgnored = default(bool);
|
||||
bool isFeatureIgnored = default(bool);
|
||||
if ((tagsOfScenario != null))
|
||||
{
|
||||
isScenarioIgnored = tagsOfScenario.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any();
|
||||
}
|
||||
if ((this._featureTags != null))
|
||||
{
|
||||
isFeatureIgnored = this._featureTags.Where(__entry => __entry != null).Where(__entry => String.Equals(__entry, "ignore", StringComparison.CurrentCultureIgnoreCase)).Any();
|
||||
}
|
||||
if ((isScenarioIgnored || isFeatureIgnored))
|
||||
{
|
||||
testRunner.SkipScenario();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ScenarioStart();
|
||||
#line 8
|
||||
testRunner.Given("I have entered 50 into the calculator", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
|
||||
#line hidden
|
||||
#line 9
|
||||
testRunner.And("I have entered 70 into the calculator", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
#line 10
|
||||
testRunner.When("I press add", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
#line 11
|
||||
testRunner.Then("the result should be 120 on the screen", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line hidden
|
||||
}
|
||||
this.ScenarioCleanup();
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore
|
||||
#endregion
|
||||
35
RealLifeUnitTest/RealLifeUnitTest.csproj
Normal file
35
RealLifeUnitTest/RealLifeUnitTest.csproj
Normal file
@@ -0,0 +1,35 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="nunit" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
||||
<PackageReference Include="FluentAssertions" Version="5.10.2" />
|
||||
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
|
||||
<PackageReference Include="gherkin" Version="6.0.0" />
|
||||
<PackageReference Include="SpecFlow" Version="3.1.86" />
|
||||
<PackageReference Include="SpecFlow.NUnit" Version="3.1.86" />
|
||||
<PackageReference Include="SpecFlow.Tools.MsBuild.Generation" Version="3.1.86" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="UnitTest1.cs" />
|
||||
<Compile Remove="Features\example.feature.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Features\" />
|
||||
<Folder Include="FeatureSteps\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SpecFlowFeatureFiles Update="Features\example.feature">
|
||||
<Generator>SpecFlowSingleFileGenerator</Generator>
|
||||
<LastGenOutput>example.feature.cs</LastGenOutput>
|
||||
</SpecFlowFeatureFiles>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user