public void ShouldCountDistinctsCorrectlyForData() { using (AOC aoc = new AOC()) { List <int> expected = new List <int>() { 3, 3, 3, 1, 1 }; Assert.Equal(expected, aoc.CountDistinctAnswers(input)); } }
public void ShouldAddAllDistinctValuesCorrectly() { using (AOC aoc = new AOC()) { List <int> distinctAnswers = aoc.CountDistinctAnswers(input_2); //int ans = distinctAnswers.Aggregate(1, (x,y) => x * y); int prod = 0; foreach (int value in distinctAnswers) { if (value == 0) { continue; } prod += value; } Assert.Equal(7128, prod); } }