public ExecutionPlan(Configuration config) { classBehaviors = BuildClassBehaviorChain(config, BuildFixtureBehaviorChain(config, BuildCaseBehaviorChain(config))); }
static ClassBehavior GetInnermostBehavior(Configuration config, BehaviorChain<Fixture> fixtureBehaviors) { if (config.ConstructionFrequency == ConstructionFrequency.PerCase) return new CreateInstancePerCase(config.TestClassFactory, fixtureBehaviors); return new CreateInstancePerClass(config.TestClassFactory, fixtureBehaviors); }
static BehaviorChain<Case> BuildCaseBehaviorChain(Configuration config) { var chain = config.CustomCaseBehaviors .Select(customBehavior => customBehavior()) .ToList(); chain.Add(new InvokeMethod()); return new BehaviorChain<Case>(chain); }
static BehaviorChain<Fixture> BuildFixtureBehaviorChain(Configuration config, BehaviorChain<Case> caseBehaviors) { var chain = config.CustomFixtureBehaviors .Select(customBehavior => customBehavior()) .ToList(); chain.Add(new ExecuteCases(caseBehaviors)); return new BehaviorChain<Fixture>(chain); }
static BehaviorChain<Class> BuildClassBehaviorChain(Configuration config, BehaviorChain<Fixture> fixtureBehaviors) { var chain = config.CustomClassBehaviors .Select(customBehavior => customBehavior()) .ToList(); chain.Add(GetInnermostBehavior(config, fixtureBehaviors)); return new BehaviorChain<Class>(chain); }
public ClassRunner(Listener listener, Configuration config) { this.listener = listener; executionPlan = new ExecutionPlan(config); methodDiscoverer = new MethodDiscoverer(config); parameterDiscoverer = new ParameterDiscoverer(config); assertionLibraryFilter = new AssertionLibraryFilter(config); skipRules = config.SkipRules; orderCases = config.OrderCases; }
public Convention() { Config = new Configuration(); Classes = new ClassExpression(Config); Methods = new MethodExpression(Config);; Parameters = new ParameterSourceExpression(Config); CaseExecution = new CaseBehaviorExpression(Config); FixtureExecution = new FixtureBehaviorExpression(Config); ClassExecution = new ClassBehaviorExpression(Config); HideExceptionDetails = new AssertionLibraryExpression(Config); }
public AssertionLibraryFilter(Configuration config) { exceptionTypes = new List<Type>(); stackTraceTypes = new List<Type>(); foreach (var type in config.AssertionLibraryTypes) { bool isExceptionType = type.IsSubclassOf(typeof(Exception)); if (isExceptionType) exceptionTypes.Add(type); else stackTraceTypes.Add(type); } }
public MethodDiscoverer(Configuration config) { testMethodConditions = config.TestMethodConditions.ToArray(); }
public ClassDiscoverer(Configuration config) { testClassConditions = config.TestClassConditions.ToArray(); }
public ParameterDiscoverer(Configuration config) { parameterSources = config.ParameterSources .Select(sourceType => sourceType()) .ToArray(); }