public TestConvention() { Classes.NameEndsWith("Test"); ClassExecution.CreateInstancePerCase(); Methods.Where(x => x.IsVoid() && x.IsPublic); FixtureExecution.Wrap <AMFixtureBehavior>(); }
/// <summary> /// Initializes a new instance of the <see cref="LightInjectConvention"/> class. /// </summary> public LightInjectConvention() { FixtureExecution.Wrap(WrapFixtureExecution); CaseExecution.Wrap(WrapCaseExecution); ClassExecution.Wrap(WrapClassExecution); ClassExecution.UsingFactory(CreateTestClassInstance); }
public FixturePerMethodConvention() { Classes .ConstructorDoesntHaveArguments(); ClassExecution .CreateInstancePerCase(); FixtureExecution .Wrap <ClearPermissions>() .Wrap <DeleteData>(); }
public FixturePerMethodConvention() { Classes .IsBddStyleClassNameOrEndsWithTests() .ConstructorDoesntHaveArguments(); ClassExecution .CreateInstancePerCase(); FixtureExecution .Wrap <DeleteData>(); }
public TestConvention() { FixtureExecution.Wrap <FixtureSetupBehavior>(); Classes.NameEndsWith("test", "Test"); Methods .Where(x => x.IsVoid() && x.IsPublic && x.Name != "FixtureSetup" && x.Name != "FixtureTearDown"); ClassExecution .CreateInstancePerClass(); }
public CustomConvention() { Classes .Where(HasAnyFactMethods); Methods .HasOrInherits <FactAttribute>(); ClassExecution .CreateInstancePerCase() .Wrap <PrepareAndDisposeFixtureData>() .ShuffleCases(); FixtureExecution .Wrap <InjectFixtureData>(); }
/// <summary> /// Initializes a new instance of the <see cref="FixieSpecConvention"/> class. /// </summary> public FixieSpecConvention() { Methods .Where(method => method.IsAssertionStep()); ClassExecution .CreateInstancePerClass() .SortCases((firstCase, secondCase) => DeclarationOrderComparer.Default.Compare(firstCase.Method, secondCase.Method)); CaseExecution .Skip(SkipWhenSpecificationIsInconclusive) .Skip(SkipWhenAssertionStepIsInconclusive); FixtureExecution .Wrap(new ExecuteSpecificationSteps(method => method.IsTransitionStep())) .Wrap(new ExecuteSpecificationSteps(method => method.IsSetupStep())); }
public CustomConvention() { Classes .HasOrInherits <TestFixtureAttribute>(); Methods .HasOrInherits <TestAttribute>().Where(m => !m.HasAttribute <ExplicitAttribute>()); ClassExecution .CreateInstancePerClass() .SortCases((caseA, caseB) => String.Compare(caseA.Name, caseB.Name, StringComparison.Ordinal)); FixtureExecution .Wrap <FixtureSetUpTearDown>(); CaseExecution .Wrap <SetUpTearDown>(); }
public FixturePerMethodConvention() { Classes .ClassNameIsBddStyleOrEndsWithTests() .ConstructorDoesntHaveArguments(); ClassExecution .CreateInstancePerCase(); Parameters.Add( methodInfo => (methodInfo.GetParameters().Length == 1) && (methodInfo.GetParameters()[0].ParameterType == typeof(SliceFixture)) ? new[] { new[] { new SliceFixture() } } : null); FixtureExecution.Wrap <DeleteData>(); }
public CustomConvention() { Classes .Where(HasAnyFactMethods); Methods .HasOrInherits <FactAttribute>(); ClassExecution .CreateInstancePerCase() .Wrap <PrepareAndDisposeFixtureData>() .ShuffleCases(); FixtureExecution .Wrap <InjectFixtureData>(); CaseExecution .Skip(c => c.Method.GetCustomAttributes <FactAttribute>().Any(fa => !string.IsNullOrEmpty(fa.Skip))); }
public TestConvention() { FixtureExecution.Wrap <FixtureSetupBehavior>(); Classes .NameEndsWith("test", "Test"); ClassExecution .CreateInstancePerClass(); Methods .Where( x => x.IsVoid() && x.IsPublic && x.CustomAttributes.All(a => a.AttributeType.Name != "IgnoreAttribute") && x.Name != "FixtureSetup" && x.Name != "FixtureTearDown" && x.Name != "RegisterDatabase"); }
public CustomConvention() { Classes .Where(type => type.IsInNamespace(GetType().Namespace)) .NameEndsWith("Tests"); Methods .Where(method => method.IsVoid()) .Where(method => LifecycleMethods.All(x => x != method.Name)); ClassExecution .CreateInstancePerClass() .SortCases((caseA, caseB) => String.Compare(caseA.Name, caseB.Name, StringComparison.Ordinal)); FixtureExecution .Wrap <CallFixtureSetUpTearDownMethodsByName>(); CaseExecution .Wrap <CallSetUpTearDownMethodsByName>(); }
public CustomConvention() { Classes .HasOrInherits <TestFixtureAttribute>(); Methods .HasOrInherits <TestAttribute>(); Parameters .Add <TestCaseSourceAttributeParameterSource>(); ClassExecution .CreateInstancePerClass() .SortCases((caseA, caseB) => String.Compare(caseA.Name, caseB.Name, StringComparison.Ordinal)); FixtureExecution .Wrap <FixtureSetUpTearDown>(); CaseExecution .Wrap <SupportExpectedExceptions>() .Wrap <SetUpTearDown>(); }
public FullSliceConvention() { var env = Options <CliArgs>(); Classes .IsBddStyleClassNameOrEndsWithTests() .HasNoClassAttributes(); ClassExecution .CreateInstancePerCase(); Methods .Where(method => method.IsPublic); Parameters.Add( mi => (mi.GetParameters().Length == 1) && (mi.GetParameters()[0].ParameterType == typeof(FullSliceFixture)) ? new[] { new[] { new FullSliceFixture(env.Env) } } : null); FixtureExecution .Wrap <DeleteData>(); }