View CustomerRegistrationService.cs
using System; | |
using Website.Domain; | |
namespace Website.Domain.Customers | |
{ | |
public class ContactRegistrationService : IRegisterContactCommandHandler, IActivateExistingContactCommandHandler | |
{ | |
private readonly ITransactionProvider _transactor; | |
private readonly ISelfRegistrationValidator _validator; | |
private readonly ICompanyRepository _companyRepo; |
View IIS Express System tests dokumentation
PDF document from our internal wiki, explaining the WHY's and HOW's | |
https://www.dropbox.com/s/6vjkv6qysahzcih/apiTests.pdf?dl=0 | |
COMPONENTS USED TO FACILITATE THIS KIND OF TESTING | |
IIS Express instrumentation | |
https://gist.github.com/JulianMay/5d73c1708186532b61751b6e1b7e023e | |
Assertion DSL (chaining expextations for API responses) | |
https://gist.github.com/JulianMay/ef3d367a22829181e42a179fa97ce51f |
View Example how to hook up Test to IISExpress class
[SetUpFixture] //NUnit's "before all tests" | |
public class SystemTestInit | |
{ | |
private IISExpress iis; | |
[SetUp] | |
public void Init() | |
{ | |
if (iis != null) | |
throw new InvalidOperationException("IIS express is already configured!"); |
View CompositeResponseAssert.cs
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
using RestSharp; | |
namespace ProjectName.Tests.System | |
{ | |
public class CompositeResponseAssert : IResponseAssert | |
{ | |
private readonly ResponseAssert[] _responses; |
View JsonComparer.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Newtonsoft.Json; | |
using System.Text; | |
namespace ProjectName.Tests.System.json | |
{ | |
public class JsonComparer | |
{ |