Created
June 3, 2016 14:41
-
-
Save Zoxive/3cc3ad933f814e3a364fff7c3ac17274 to your computer and use it in GitHub Desktop.
BenchmarkDotNet getting variables inside a test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CreateQuotes | |
{ | |
public CreateQuotes() | |
{ | |
// TODO get access to string[] args from Program.Main(args) | |
var options = // Read From a Singleton? or from App.config? | |
} | |
[Benchmark] | |
public void NonConfig() | |
{ | |
// benchmark stuff | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
// Set args on a static singleton (doesnt work) | |
// Save args to app.config? | |
var cfg = ManualConfig.Create(DefaultConfig.Instance) | |
.With(Job.Dry); | |
BenchmarkRunner.Run<CreateQuotes>(cfg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment