Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Last active December 7, 2019 14:43
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/d65e1109ae11194ceb26105aa85823cc to your computer and use it in GitHub Desktop.
Save IntegerMan/d65e1109ae11194ceb26105aa85823cc 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 =>
{
// This analyzer's result will returned
experiment.Use(() => oldAnalyzer.Analyze(resume));
// This will be run, but its value will not be returned
experiment.Try(() => newAnalyzer.Analyze(resume));
// Tell Scientist how to compare two results
experiment.Compare((x, y) => x.Score == y.Score);
experiment.AddContext("Person", resume.FullName);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment