Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74654b1
commit 6ab726c
Showing
19 changed files
with
592 additions
and
75 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
Specification/Customers/GetCustomersList/GetCustomersList.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Get Customers List | ||
As a sales person | ||
I want to get a list of customers | ||
So I can inspect the customers | ||
|
||
Scenario: Get a List of Customers | ||
When I request a list of customers | ||
Then the following customers should be returned: | ||
| Id | Name | | ||
| 1 | Martin Fowler | | ||
| 2 | Uncle Bob | | ||
| 3 | Kent Beck | |
97 changes: 97 additions & 0 deletions
97
Specification/Customers/GetCustomersList/GetCustomersList.feature.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
Specification/Customers/GetCustomersList/GetCustomersListSteps.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using CleanArchitecture.Application.Customers.Queries.GetCustomerList; | ||
using CleanArchitecture.Specification.Common; | ||
using NUnit.Framework; | ||
using TechTalk.SpecFlow; | ||
using TechTalk.SpecFlow.Assist; | ||
|
||
namespace CleanArchitecture.Specification.Customers.GetCustomersList | ||
{ | ||
[Binding] | ||
public class GetCustomersListSteps | ||
{ | ||
private readonly AppContext _context; | ||
private List<CustomerModel> _results; | ||
|
||
public GetCustomersListSteps(AppContext context) | ||
{ | ||
_context = context; | ||
} | ||
|
||
[When(@"I request a list of customers")] | ||
public void WhenIRequestAListOfCustomers() | ||
{ | ||
var query = _context.Container | ||
.GetInstance<GetCustomersListQuery>(); | ||
|
||
_results = query.Execute(); | ||
} | ||
|
||
[Then(@"the following customers should be returned:")] | ||
public void ThenTheFollowingCustomersShouldBeReturned(Table table) | ||
{ | ||
var models = table.CreateSet<CustomerModel>().ToList(); | ||
|
||
for (var i = 0; i < models.Count(); i++) | ||
{ | ||
var model = models[i]; | ||
|
||
var result = _results[i]; | ||
|
||
Assert.That(result.Id, | ||
Is.EqualTo(model.Id)); | ||
|
||
Assert.That(result.Name, | ||
Is.EqualTo(model.Name)); | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Specification/Employees/GetEmployeesList/GetEmployeesList.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Get Employees List | ||
As a sales person | ||
I want to get a list of employees | ||
So I can inspect the employees | ||
|
||
Scenario: Get a List of Employees | ||
When I request a list of employees | ||
Then the following employees should be returned: | ||
| Id | Name | | ||
| 1 | Eric Evans | | ||
| 2 | Greg Young | | ||
| 3 | Udi Dahan | |
97 changes: 97 additions & 0 deletions
97
Specification/Employees/GetEmployeesList/GetEmployeesList.feature.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
Specification/Employees/GetEmployeesList/GetEmployeesListSteps.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using CleanArchitecture.Application.Employees.Queries.GetEmployeesList; | ||
using CleanArchitecture.Specification.Common; | ||
using NUnit.Framework; | ||
using TechTalk.SpecFlow; | ||
using TechTalk.SpecFlow.Assist; | ||
|
||
namespace CleanArchitecture.Specification.Employees.GetEmployeesList | ||
{ | ||
[Binding] | ||
public class GetEmployeesListSteps | ||
{ | ||
private readonly AppContext _context; | ||
private List<EmployeeModel> _results; | ||
|
||
public GetEmployeesListSteps(AppContext context) | ||
{ | ||
_context = context; | ||
} | ||
|
||
[When(@"I request a list of employees")] | ||
public void WhenIRequestAListOfEmployees() | ||
{ | ||
var query = _context.Container | ||
.GetInstance<GetEmployeesListQuery>(); | ||
|
||
_results = query.Execute(); | ||
} | ||
|
||
[Then(@"the following employees should be returned:")] | ||
public void ThenTheFollowingEmployeesShouldBeReturned(Table table) | ||
{ | ||
var models = table.CreateSet<EmployeeModel>().ToList(); | ||
|
||
for (var i = 0; i < models.Count(); i++) | ||
{ | ||
var model = models[i]; | ||
|
||
var result = _results[i]; | ||
|
||
Assert.That(result.Id, | ||
Is.EqualTo(model.Id)); | ||
|
||
Assert.That(result.Name, | ||
Is.EqualTo(model.Name)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Get Products List | ||
As a sales person | ||
I want to get a list of products | ||
So I can inspect the products | ||
|
||
Scenario: Get a List of Products | ||
When I request a list of products | ||
Then the following products should be returned: | ||
| Id | Name | Unit Price | | ||
| 1 | Spaghetti | 5.00 | | ||
| 2 | Lasagne | 10.00 | | ||
| 3 | Ravioli | 15.00 | |
Oops, something went wrong.