private void TestSimilarColors(ICollection<FormatDefinitionStyle> styles, String groupName) { var foregroundColors = styles.Select(s => s.ForegroundColor).Distinct().ToList(); Assert.IsTrue(foregroundColors.Count <= 1, $"Some {groupName} styles has different colors"); }