Skip to content

Instantly share code, notes, and snippets.

@nylen
Created September 29, 2010 20:23
Show Gist options
  • Save nylen/603472 to your computer and use it in GitHub Desktop.
Save nylen/603472 to your computer and use it in GitHub Desktop.
// Set list of models for next steps
switch (Wizard.TestingMode) {
case TestingMode.Run:
Wizard.Models = newModels.Keys.ToDictionary(
m => m,
x => dummyArray);
break;
case TestingMode.RunAndCompare:
Wizard.Models = newModels.Keys.ToDictionary(
m => m,
m => (oldTestSet.ContainsModel(m)
? oldTestSet[m].Intersect(newTestSet[m]).ToArray()
: dummyArray));
break;
case TestingMode.ViewPreviousResults:
// Right now all models are included, even if
// they don't have any associated comparison results.
Wizard.Models = oldModels.Keys.ToDictionary(
m => m,
m => oldTestSet[m].Where(
o => oldTestSet.OutputFileHasResults(o)).ToArray());
break;
case TestingMode.Compare:
Wizard.Models = oldModels.Keys
.Intersect(newModels.Keys).ToDictionary(
m => m,
m => oldTestSet[m].Intersect(newTestSet[m]).ToArray())
.Where(entry => entry.Value.Length > 0)
.ToDictionary(
entry => entry.Key,
entry => entry.Value);
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment