Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created December 7, 2019 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/9d6fe758f27ca36a4a9f7af5a29cc23b to your computer and use it in GitHub Desktop.
Save IntegerMan/9d6fe758f27ca36a4a9f7af5a29cc23b to your computer and use it in GitHub Desktop.
public AnalysisResult Analyze(Resume resume) {
var oldAnalyzer = new LegacyAnalyzer();
var newAnalyzer = new ExperimentalAnalyzer();
return Scientist.Science<AnalysisResult>("Simple Experiment",
experiment =>
{
// ONLY DO THIS FOR UNIT TESTS!
experiment.ThrowOnMismatches = true;
experiment.Use(() => oldAnalyzer.Analyze(resume));
experiment.Try(() => newAnalyzer.Analyze(resume));
experiment.Compare((x, y) => x.Score == y.Score);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment