Skip to content
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

Various fixes for the C# implementation #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions csharp/CurrencyConverter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.vs/
bin/
obj/

CurrencyConverter.Tests/Features/Calculator.feature.cs

TestResults/
11 changes: 11 additions & 0 deletions csharp/CurrencyConverter/CurrencyConverter.Tests/Calculator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CurrencyConverter.Tests
{
public class Calculator
{
public static int Add(int x, int y)
{
return x + y;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="SpecFlow.Plus.LivingDocPlugin" Version="3.9.57" />
<PackageReference Include="SpecRun.SpecFlow" Version="3.9.7" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
</ItemGroup>

</Project>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using FluentAssertions;
using Shouldly;
using TechTalk.SpecFlow;

namespace CurrencyConverter.Tests.Steps
Expand Down Expand Up @@ -33,14 +33,17 @@ public void WhenTheTwoNumbersAreAdded()
{
var first = _scenarioContext.Get<int>("first");
var second = _scenarioContext.Get<int>("second");
_scenarioContext.Add("result", first + second);

var sum = Calculator.Add(first, second);

_scenarioContext.Add("result", sum);
}

[Then("the result should be (.*)")]
public void ThenTheResultShouldBe(int result)
{
var actualResult = _scenarioContext.Get<int>("result");
actualResult.Should().Equals(result);
actualResult.ShouldBe(result);
}
}
}