Example #1
0
 /// <summary>
 /// Backwards-compatible constructor for NBench 0.1.6 and earlier.
 /// </summary>
 /// <param name="settings">The settings for this benchmark.</param>
 /// <param name="invoker">The invoker used to execute benchmark and setup / cleanup methods.</param>
 /// <param name="writer">The output target this benchmark will write to.</param>
 /// <param name="benchmarkAssertions">The assertion engine we'll use to perform BenchmarkAssertions against benchmarks.</param>
 public Benchmark(BenchmarkSettings settings, IBenchmarkInvoker invoker, IBenchmarkOutput writer, IBenchmarkAssertionRunner benchmarkAssertions)
 {
     Settings                 = settings;
     _warmupCount             = _pendingIterations = Settings.NumberOfIterations;
     Invoker                  = invoker;
     Output                   = writer;
     CompletedRuns            = new Queue <BenchmarkRunReport>(Settings.NumberOfIterations);
     Builder                  = new BenchmarkBuilder(Settings);
     BenchmarkAssertionRunner = benchmarkAssertions;
 }
Example #2
0
 /// <summary>
 /// Backwards-compatible constructor for NBench 0.1.6 and earlier.
 /// </summary>
 /// <param name="settings">The settings for this benchmark.</param>
 /// <param name="invoker">The invoker used to execute benchmark and setup / cleanup methods.</param>
 /// <param name="writer">The output target this benchmark will write to.</param>
 /// <param name="benchmarkAssertions">The assertion engine we'll use to perform BenchmarkAssertions against benchmarks.</param>
 public Benchmark(BenchmarkSettings settings, IBenchmarkInvoker invoker, IBenchmarkOutput writer, IBenchmarkAssertionRunner benchmarkAssertions)
 {
     Settings = settings;
     _warmupCount = _pendingIterations = Settings.NumberOfIterations;
     Invoker = invoker;
     Output = writer;
     CompletedRuns = new Queue<BenchmarkRunReport>(Settings.NumberOfIterations);
     Builder = new BenchmarkBuilder(Settings);
     BenchmarkAssertionRunner = benchmarkAssertions;
 }
 public ReflectionDiscovery(IBenchmarkOutput output, IBenchmarkAssertionRunner benchmarkAssertions, RunnerSettings settings)
 {
     Output = output;
     BenchmarkAssertions = benchmarkAssertions;
     RunnerSettings      = settings;
     if (RunnerSettings.TracingEnabled)
     {
         Trace = new BenchmarkOutputTrace(Output);
     }
     else
     {
         Trace = NoOpBenchmarkTrace.Instance;
     }
 }
Example #4
0
 public ReflectionDiscovery(IBenchmarkOutput output, IBenchmarkAssertionRunner benchmarkAssertions, RunnerSettings settings)
 {
     Output = _reflectionOutput = output;
     BenchmarkAssertions = benchmarkAssertions;
     RunnerSettings = settings;
     if(RunnerSettings.TracingEnabled)
         Trace = new BenchmarkOutputTrace(Output);
     else
         Trace = NoOpBenchmarkTrace.Instance;
 }
 public ReflectionDiscovery(IBenchmarkOutput output, IBenchmarkAssertionRunner benchmarkAssertions)
 {
     Output = _reflectionOutput = output;
     BenchmarkAssertions = benchmarkAssertions;
 }