Skip to content

Instantly share code, notes, and snippets.

@plioi
Created October 5, 2013 21:47
Show Gist options
  • Save plioi/6846456 to your computer and use it in GitHub Desktop.
Save plioi/6846456 to your computer and use it in GitHub Desktop.
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()
{
Classes
.NameEndsWith("Tests");
Methods
.Where(method => method.IsVoid());
Parameters(type => autoFixture.Create(type));
}
private void Parameters(Func<Type, object> parameterByType)
{
Parameters(method =>
{
var parameterTypes = method.GetParameters().Select(x => x.ParameterType);
var parameterValues = parameterTypes.Select(parameterByType).ToArray();
return new[] { parameterValues };
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment