Skip to content

Commit

Permalink
Removing out of range test, correcting names of large numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Pethick authored and Oren Novotny committed May 4, 2017
1 parent 06871bb commit 125cb28
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/Humanizer.Tests.Shared/NumberToWordsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public void ToWords(int number, string expected)
[InlineData(11111111111111111L, "eleven quadrillion one hundred and eleven trillion one hundred and eleven billion one hundred and eleven million one hundred and eleven thousand one hundred and eleven")]
[InlineData(111111111111111111L, "one hundred and eleven quadrillion one hundred and eleven trillion one hundred and eleven billion one hundred and eleven million one hundred and eleven thousand one hundred and eleven")]
[InlineData(1111111111111111111L, "one quintillion one hundred and eleven quadrillion one hundred and eleven trillion one hundred and eleven billion one hundred and eleven million one hundred and eleven thousand one hundred and eleven")]
[InlineData(11111111111111111111L, "eleven quintillion one hundred and eleven quadrillion one hundred and eleven trillion one hundred and eleven billion one hundred and eleven million one hundred and eleven thousand one hundred and eleven")]
[Theory]
public void ToWords(long number, string expected)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Humanizer.Tests.Shared/ToQuantityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ public void ToQuantityWords(string word, int quantity, string expected)
Assert.Equal(expected, word.ToQuantity(quantity, ShowQuantityAs.Words));
Assert.Equal(expected, word.ToQuantity((long)quantity, ShowQuantityAs.Words));
}
public void ToQuantityWordsThrowsErrorIfGreaterThanInt32()
{
Assert.Throws<NotImplementedException>(() => "case".ToQuantity(10000000000, ShowQuantityAs.Words));
}

[Theory]
[InlineData("case", 0, null, "0 cases")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ private string Convert(long number, bool isOrdinal)

if ((number / 1000000000000000000) > 0)
{
parts.Add(string.Format("{0} quadrillion", Convert(number / 1000000000000000000)));
parts.Add(string.Format("{0} quintillion", Convert(number / 1000000000000000000)));
number %= 1000000000000000000;
}

if ((number / 1000000000000000) > 0)
{
parts.Add(string.Format("{0} trillion", Convert(number / 1000000000000000)));
parts.Add(string.Format("{0} quadrillion", Convert(number / 1000000000000000)));
number %= 1000000000000000;
}

Expand Down

0 comments on commit 125cb28

Please sign in to comment.