private string GetString(ParsedNumber[] groups, bool includeZero = false) { // get the string representation of each group var strings = new List <string>(); foreach (var item in groups) { if (item.Value == 0 && !includeZero) { continue; } var valueString = NumberParser.GetGroupString(item.Value, item.Group, includeZero: includeZero, includeAnd: true); strings.Add(valueString); } return(string.Join(", ", strings)); }
public void GetGroupString_Should_Return_Correctly(int value, DigitGroupEnum group, bool includeZero, bool includeAnd, string expected) { NumberParser.GetGroupString(value, group, includeZero, includeAnd).Should().Be(expected); }