Skip to content

Instantly share code, notes, and snippets.

public class ContactEditTests
{
...
public void ShouldSaveChangesToSelectedContact(Contact contactToEdit, Contact anotherContact)
{
Save(contactToEdit, anotherContact);
var selectedContactId = contactToEdit.Id;
public class ContactEditTests
{
...
public void ShouldRequireMinimumFields()
{
new ContactEdit.Command()
.ShouldNotValidate("'Name' should not be empty.");
}
namespace ContactList.Tests.Features
{
using Core.Domain;
using ContactList.Features.Contact;
using static Testing;
using Should;
public class ContactEditTests
{
public void ShouldDisplaySelectedContact(Contact contactToEdit, Contact anotherContact)
namespace ContactList.Features.Contact
{
using System.Web.Mvc;
using MediatR;
public class ContactController : Controller
{
private readonly IMediator _mediator;
public ContactController(IMediator mediator)
using System;
using System.Linq;
using MediatR;
using Should;
using static Testing;
public static class Assertions
{
public static void ShouldValidate<TResponse>(this IRequest<TResponse> message)
{
public static class TestDependencyScope
{
private static IContainer _currentNestedContainer;
public static void Begin()
{
if (_currentNestedContainer != null)
throw new Exception("Cannot begin test dependency scope. Another dependency scope is still in effect.");
_currentNestedContainer = IoC.Container.GetNestedContainer();
public class AutoMapperTests
{
public void ShouldHaveValidConfiguration()
{
Mapper.AssertConfigurationIsValid();
}
}
@plioi
plioi / appveyor.yml
Created January 8, 2016 04:32
A basic AppVeyor configuration starting point.
version: '{build} ({branch})'
skip_tags: true
init:
- cmd: git config --global core.autocrlf true
build_script:
- cmd: build
test: off
@plioi
plioi / Main.cs
Last active January 3, 2016 17:19
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
public static int Main(string[] args)...
var instance = new Thing();
var method = typeof(Thing).GetMethod("GenericMethod");
var methodOfInt32 = method.MakeGenericMethod(typeof(int));
methodOfInt32.Invoke(instance, new object[] { 1 });
var methodOfBoolean = method.MakeGenericMethod(typeof(bool));
methodOfBoolean.Invoke(instance, new object[] { true });