public void GeneratedColorsAreDifferent(int numberOfColors) { var sut = new ColorGenerator(); var expected = sut.GenerateColors(numberOfColors); var actual = expected.Distinct(); Assert.Equal(expected, actual); }
public void GenerateColorsReturnsTheGivenCountOfColors(int numberOfColors) { var sut = new ColorGenerator(); var colors = sut.GenerateColors(numberOfColors); var expected = numberOfColors; var actual = colors.Count; Assert.Equal(expected, actual); }
public static IEnumerable<Blink1Identifier> Identify(TimeSpan identifyTime) { var colorGenerator = new ColorGenerator(); var blinks = Scan().ToList(); var colors = colorGenerator.GenerateColors(blinks.Count()); var blink1Identifiers = (from b in blinks from c in colors select new Blink1Identifier(b, c)).ToList(); Parallel.ForEach(blink1Identifiers, bi => { var blink1 = bi.Blink1; blink1.Show(bi.Color, identifyTime); }); return blink1Identifiers; }