public void PossibleGhostsFromEvidence(Evidences evidences, params Ghost[] expected) { var actual = evidences.GetGhosts().ToList(); Assert.Equal(expected.Length, actual.Count); Assert.Equal(expected.OrderBy(o => o), actual.OrderBy(o => o)); }
public void GhostsFromFoundAndEliminatedEvidence(Evidences found, Evidences eliminated, params Ghost[] expected) { var actual = found.GetGhosts(eliminated).ToList(); Assert.Equal(expected.Length, actual.Count); Assert.Equal(expected.OrderBy(o => o), actual.OrderBy(o => o)); }
public static IEnumerable <Ghost> GetGhosts(this Evidences found, Evidences eliminated) { var left = found.GetGhosts(); var right = eliminated.GetEliminatedGhosts(); return(from l in left from r in right where l == r select l); }