static void Main(string[] args) { Console.WriteLine("Please enter a number to spell!"); Console.Write("> "); string input; do { input = Console.ReadLine(); long number; while (!long.TryParse(input, out number)) { Console.WriteLine("Invalid number! Try again!"); Console.Write("> "); input = Console.ReadLine(); } INumberSpeller speller = new BgNumberSpeller(); string numberInWords = speller.Spell(number, Gender.Female); Console.WriteLine(numberInWords); Console.Write("> "); }while (input.ToUpper() != "EXIT"); Console.ReadLine(); }
public void Spell_ThreeDigitNumbers_Correctly(long number, string expected) { // Arrange var sut = new BgNumberSpeller(); // Act string inWords = sut.Spell(number); // Assert Assert.AreEqual(expected, inWords); }
public void Spell_Negative_Numbers_Correctly(long number, string result) { // Arrange var sut = new BgNumberSpeller(); // Act string inWords = sut.Spell(number); // Assert Assert.AreEqual(result, inWords); }
public void Spell_Positive_Numbers_Using_FemaleGender_Correctly(long number, string result) { // Arrange var sut = new BgNumberSpeller(); // Act string inWords = sut.Spell(number, Gender.Female); // Assert Assert.AreEqual(result, inWords); }
public void Spell_MaxAndMinLongNumber(long number, string expected) { // Arrange var sut = new BgNumberSpeller(); // Act string inWords = sut.Spell(number); // Assert Assert.AreEqual(expected, inWords); }