public void ConvertsWordsToNegativeNumbers() { Assert.Equal(-900013, WordToNumberConverter.Convert("negative nine hundred thousand thirteen")); Assert.Equal(-18476, WordToNumberConverter.Convert("negative eighteen thousand four hundred seventy six")); Assert.Equal(-1345678919, WordToNumberConverter.Convert("negative one billion three hundred fourty five million six hundred seventy eight thousand nine hundred nineteen")); Assert.Equal(-1, WordToNumberConverter.Convert("negative one")); Assert.Equal(-36, WordToNumberConverter.Convert("negative thirty six")); }
public void ConvertsWordsToPositiveNumbers() { Assert.Equal(900013, WordToNumberConverter.Convert("nine hundred thousand thirteen")); Assert.Equal(18476, WordToNumberConverter.Convert("eighteen thousand four hundred seventy six")); Assert.Equal(1345678919, WordToNumberConverter.Convert("one billion three hundred fourty five million six hundred seventy eight thousand nine hundred nineteen")); Assert.Equal(1, WordToNumberConverter.Convert("one")); Assert.Equal(36, WordToNumberConverter.Convert("thirty six")); }
public void DealsWithImproperInputs() { Assert.Equal(0, WordToNumberConverter.Convert(null)); Assert.Equal(0, WordToNumberConverter.Convert("")); }
public void ConvertsZeroes() { Assert.Equal("zero", NumberToWordConverter.Convert(0)); Assert.Equal(0, WordToNumberConverter.Convert("zero")); }