Skip to content

Commit 8d3c0a2

Browse files
committed
Simply test scenario file with outline
1 parent e7b2a14 commit 8d3c0a2

File tree

3 files changed

+300
-0
lines changed

3 files changed

+300
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using FluentAssertions;
2+
using SomeStuffToTest;
3+
using System;
4+
using TechTalk.SpecFlow;
5+
6+
namespace GettingStarted
7+
{
8+
[Binding]
9+
public class CheckToSeeIfTheStoreIsOpen_OutlineVersionSteps
10+
{
11+
DateTime dateToTest;
12+
13+
[Given(@"it is a certain (.*) and (.*)")]
14+
public void GivenItIsACertainAnd(string p0, string p1)
15+
{
16+
dateToTest = DateTime.Parse($"{p0} {p1}");
17+
}
18+
19+
[Then(@"The store (.*) open at that time")]
20+
public void ThenTheStoreOpen(string p0)
21+
{
22+
if (dateToTest.IsStoreOpen())
23+
{
24+
p0.ToLower().Replace(" ", "").Should().Be("is");
25+
}
26+
else
27+
{
28+
p0.ToLower().Replace(" ", "").Should().Be("isnot");
29+
}
30+
}
31+
}
32+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Feature: Check to see if the store is open - outline version
2+
As a potential customer
3+
I want to know if your store is open
4+
So I don't waste my time driving there if it isn't
5+
Store Hours:
6+
M-Th 8-10
7+
Fri 8-11
8+
Sat 10-8
9+
Sun 10-6
10+
11+
Scenario Outline: Testing multiple dates and times
12+
Given it is a certain <date> and <time>
13+
Then The store <isornot> open at that time
14+
15+
Examples:
16+
| date | time | isornot |
17+
| 12/20/2019 | 12:00 PM | is |
18+
| 12/12/2019 | 9:00 AM | is |
19+
| 01/03/2019 | 6:00 AM | isnot |
20+
| 12/12/2019 | 11:00 PM | isnot |
21+
| 12/14/2019 | 9:00 AM | isnot |
22+
| 12/14/2019 | 11:00 AM | is |
23+
| 12/12/2019 | 8:00 AM | is |
24+
| 12/12/2019 | 10:00 PM | isnot |

GettingStarted/IsStoreOpenScenarioOutlineVersion.feature.cs

Lines changed: 244 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)