public InstrumentatorParameters(ModuleDefinition dependencyMonitor, TestingFrameworkType testingFrameworkType, InstrumentationStrategy strategy, DependencyMonitor.InstrumentationArguments instrumentationArgsType, bool instrumentAtMethodBeginning) { this.DependencyMonitor = dependencyMonitor; this.TestingFrameworkType = testingFrameworkType; this.Strategy = strategy; this.InstrumentationArgsType = instrumentationArgsType; this.InstrumentAtMethodBeginning = instrumentAtMethodBeginning; }
public static Type GetArgumentsType(this TestingFrameworkType type) { switch (type) { case TestingFrameworkType.XUnit2: case TestingFrameworkType.XUnit1: return(typeof(XUnitArguments)); default: return(typeof(TestFrameworkArguments)); } }
public static Analyzer GetAnalyzer(this TestingFrameworkType testingFramework, AnalyzerParameters options) { switch (testingFramework) { case TestingFrameworkType.NUnit2: case TestingFrameworkType.NUnit3: return(new NUnitAnalyzer(options)); case TestingFrameworkType.XUnit1: case TestingFrameworkType.XUnit2: return(new XUnitAnalyzer(options)); default: throw new ArgumentOutOfRangeException(); } }
public static TestExecutor GetExecutor(this TestingFrameworkType testingFramework) { switch (testingFramework) { case TestingFrameworkType.NUnit2: return(new NUnit2TestExecutor()); case TestingFrameworkType.NUnit3: return(new NUnit3TestExecutor()); case TestingFrameworkType.XUnit1: return(new XUnitTestExecutor()); case TestingFrameworkType.XUnit2: return(new XUnitConsoleTestExecutor()); default: throw new ArgumentOutOfRangeException(); } }
public static TestInstrumentator GetTestInstrumentator(this TestingFrameworkType testingFramework, ModuleDefinition testModule, InstrumentatorParameters parameters) { switch (testingFramework) { case TestingFrameworkType.NUnit2: return(new NUnit2Instrumentator(testModule, parameters)); case TestingFrameworkType.NUnit3: return(new NUnit3Instrumentator(testModule, parameters)); case TestingFrameworkType.XUnit1: return(new XUnit1Instrumentator(testModule, parameters)); case TestingFrameworkType.XUnit2: return(new XUnit2Instrumentator(testModule, parameters)); default: throw new ArgumentOutOfRangeException(); } }