private string GetThousandsWord(ExpandedDigits expandedDigits) { if (expandedDigits.Thousands == 0 || expandedDigits.CanCompressFourDigitNumberIntoThreeDigitNotation()) { return(NumberNotFound); } return(GetUnitsWord(expandedDigits.Thousands) + " thousand "); }
public void CanCompressFourDigitNumberIntoThreeDigitNotation_WhenNotPossible_ShouldReturnFalse() { //---------------Arrange------------------- var sut = new ExpandedDigits { Thousands = 0, Hundreds = 3, Tens = 0, Units = 0 }; //---------------Act---------------------- var actual = sut.CanCompressFourDigitNumberIntoThreeDigitNotation(); //---------------Assert----------------------- actual.Should().BeFalse(); }
private string GetHundredsWord(ExpandedDigits expandedDigits) { if (expandedDigits.Hundreds == 0) { return(NumberNotFound); } if (expandedDigits.CanCompressFourDigitNumberIntoThreeDigitNotation()) { var compressedDigits = new ExpandedDigits { Tens = expandedDigits.Thousands, Units = expandedDigits.Hundreds }; var compressionResult = GetTensWord(compressedDigits) + GetUnitsWord(compressedDigits.Units); return(compressionResult + " hundred"); } return(GetUnitsWord(expandedDigits.Hundreds) + " hundred "); }