Skip to content

Instantly share code, notes, and snippets.

Classes
.NameEndsWith("Tests");
Methods
.Where(method => method.IsVoid());
TestWithNoParameters
TestWithInterestingParameters
Person: Arthur Vandelay, born on 1/1/1980 12:00:00 AM.
TestWithInterestingParameters
Person: Kel Varnsen, born on 1/1/1978 12:00:00 AM.
TestWithInterestingParameters
Person: Martin Van Nostrand, born on 1/1/1995 12:00:00 AM.
public class ParameterizedTests
{
public void TestWithNoParameters()
{
Console.WriteLine("TestWithNoParameters");
Console.WriteLine();
}
public void TestWithInterestingParameter(Person person)
{
@plioi
plioi / Success
Last active December 25, 2015 01:19
TestWithNoParameters
TestWithInterestingParameters
Person: Arthur Vandelay, born on 1/1/1980 12:00:00 AM.
TestWithInterestingParameters
Person: Kel Varnsen, born on 1/1/1978 12:00:00 AM.
TestWithInterestingParameters
Person: Martin Van Nostrand, born on 1/1/1995 12:00:00 AM.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Fixie;
using Fixie.Conventions;
public class CustomConvention : Convention
{
@plioi
plioi / Thud
Last active December 25, 2015 01:19
TestWithNoParameters
Test 'ParameterizedTests.TestWithInterestingParameter' failed: System.Reflection.TargetParameterCountException
Parameter count mismatch.
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Fixie.Case.Execute(Object instance)
1 passed, 1 failed, 0 skipped, took 0.19 seconds (Fixie 0.0.1.98).
public class ParameterizedTests
{
public void TestWithNoParameters()
{
Console.WriteLine("TestWithNoParameters");
Console.WriteLine();
}
public void TestWithInterestingParameter(Person person)
{
------ Test started: Assembly: AutoFixtureDemo.dll ------
TestWithNoParameters
TestWithTrivialParameters
i: 60
b: True
TestWithInterestingParameters
Person A: Named5bf97cd-456e-488e-b75c-67c03b10c8f2, born on 8/22/2013 10:09:20 PM.
using System;
using System.Linq;
using Fixie;
using Fixie.Conventions;
public class CustomConvention : Convention
{
readonly Ploeh.AutoFixture.Fixture autoFixture = new Ploeh.AutoFixture.Fixture();
public CustomConvention()
public static class AutoFixtureExtensions
{
//Normal AutoFixture usage is to write:
//
// var thing = autoFixture.Create<MyClass>();
//
//If all you have is an arbitrary Type object, though,
//this extension method lets you write:
//
// var thing = autoFixture.Create(type);