/// <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 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 IntegrationTestsConvention() { _container = new Container(s => s.AddRegistry <IntegrationTestRegistry>()); Classes .Where(TestClassMatcher); Methods .Where(method => method.IsVoid()); ClassExecution .CreateInstancePerClass() .UsingFactory(t => _container.GetInstance(t)); CaseExecution .Wrap(CommitBeforeTestCase); Parameters(GetMethodParameters); }
public TestingConvention() { Classes .NameEndsWith("Tests"); Methods .Where(method => method.IsVoid() || method.IsAsync()); ClassExecution .CreateInstancePerCase(); CaseExecution .Wrap <DbTestBehavior>() .Wrap <NestedContainerBehavior>() .Skip(@case => @case.Method.HasOrInherits <SkipAttribute>()); Parameters .Add <FromInputAttributes>(); }
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 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"); CaseExecution.Wrap <RepeatCase>(); }