-
Notifications
You must be signed in to change notification settings - Fork 0
/
CalculatePeriods.cs
34 lines (31 loc) · 1023 Bytes
/
CalculatePeriods.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Xunit.Gherkin.Quick;
using Feature = Xunit.Gherkin.Quick.Feature;
namespace Xunit.Gherkin.PilotProject
{
[FeatureFile("CalculatePeriods.feature")]
public class CalculatePeriods : Feature
{
public Calculator periodCalc = new Calculator();
[Given(@"I select {} as an start date")]
public void I_select_first_date(DateTime startDate)
{
periodCalc.SetStartDate(startDate);
}
[And(@"I select {} as an end date")]
public void I_select_end_date(DateTime endDate)
{
periodCalc.SetEndDate(endDate);
}
[When(@"I press calculate")]
public void calculate()
{
periodCalc.calcPeriodLengthInDays();
}
[Then(@"the result should show (\d+) on the screen")]
public void The_result_should_be_z_on_the_screen(int expectedResult)
{
var actualResult = periodCalc.Result;
Assert.Equal(expectedResult, actualResult);
}
}
}