public void ConvertsPositiveNumbersToWords()
 {
     Assert.Equal("eight hundred", NumberToWordConverter.Convert(800));
     Assert.Equal("one hundred million four hundred fifty six thousand three hundred ninety six", NumberToWordConverter.Convert(100456396));
     Assert.Equal("three hundred thousand thirteen", NumberToWordConverter.Convert(300013));
     Assert.Equal("one", NumberToWordConverter.Convert(1));
     Assert.Equal("one billion", NumberToWordConverter.Convert(1000000000));
 }
 public void ConvertsNegativeNumbersToWords()
 {
     Assert.Equal("negative eight hundred", NumberToWordConverter.Convert(-800));
     Assert.Equal("negative one hundred million four hundred fifty six thousand three hundred ninety six", NumberToWordConverter.Convert(-100456396));
     Assert.Equal("negative three hundred thousand thirteen", NumberToWordConverter.Convert(-300013));
     Assert.Equal("negative one", NumberToWordConverter.Convert(-1));
     Assert.Equal("negative one billion", NumberToWordConverter.Convert(-1000000000));
 }
 public void ConvertsZeroes()
 {
     Assert.Equal("zero", NumberToWordConverter.Convert(0));
     Assert.Equal(0, WordToNumberConverter.Convert("zero"));
 }
Esempio n. 4
0
 static void Main(string[] args)
 {
     Console.WriteLine(NumberToWordConverter.Convert(800));
     Console.ReadLine();
 }