private string GetGatedUnitWord(ExpandedDigits digits) { if (digits.IsTeenNumber() || MultiDigitNumberEndingWithZero(digits)) { return(NumberNotFound); } return(GetUnitsWord(digits.Units)); }
public void IsTeenNumber_WhenIs20_ShouldReturnFalse() { //---------------Arrange------------------- var sut = new ExpandedDigits { Tens = 2, Units = 0 }; //---------------Act---------------------- var actual = sut.IsTeenNumber(); //---------------Assert----------------------- actual.Should().BeFalse(); }
public void IsTeenNumber_WhenIs11Through19_ShouldReturnTrue(int tens, int units) { //---------------Arrange------------------- var sut = new ExpandedDigits { Tens = tens, Units = units }; //---------------Act---------------------- var actual = sut.IsTeenNumber(); //---------------Assert----------------------- actual.Should().BeTrue(); }
private string GetTensWord(ExpandedDigits digits) { if (digits.Tens == 0) { return(NumberNotFound); } if (digits.IsTeenNumber()) { return(GetTeenNumberWord(digits)); } return(GetTensDigitWord(digits)); }