Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian May JulianMay

View GitHub Profile
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
@JulianMay
JulianMay / Example how to hook up Test to IISExpress class
Last active May 14, 2019
Handles starting/stopping IIS Express for your black-box systemtests (Relative path hardcoded - look for {YOURWEBPROJECTROOTFOLDER})
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!");
@JulianMay
JulianMay / CompositeResponseAssert.cs
Last active Oct 20, 2016
Assertion DSL for Rest Responses
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;
@JulianMay
JulianMay / JsonComparer.cs
Last active Nov 25, 2016
"By example" assertions of json-documents
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
{