Last active
December 7, 2019 14:43
-
-
Save IntegerMan/d65e1109ae11194ceb26105aa85823cc to your computer and use it in GitHub Desktop.
This file contains 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 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