public void NegativeNumber_Should_ThrowException() { //Arrange var spltotxt = new SpellToText(); //Act Assert Assert.Throws(typeof(NegativeIntegerException), delegate { spltotxt.Spell(-1); }); }
public void SpellTrail_Should_Return_ValidText(int number, string text, string trail) { //Arrange var spltotxt = new SpellToText(); //Act var _text = spltotxt.Spell(number, trail); //Assert Assert.AreEqual($"{text} {trail}", _text); }
public void Spell_Should_Return_ValidText(int number, string text) { //Arrange var spltotxt = new SpellToText(); //Act var _text = spltotxt.Spell(number); //Assert Assert.AreEqual(text, _text); }
static void Main(string[] args) { do { Console.Clear(); Console.WriteLine($"Enter a number upto {int.MaxValue}"); var number = 0; int.TryParse(Console.ReadLine(), out number); var spltotext = new SpellToText(); try { Console.WriteLine(spltotext.Spell(number)); } catch (NegativeIntegerException ex) { Console.WriteLine($"[{number}]: {ex.Message}"); } }while (Console.ReadKey().Key != ConsoleKey.Escape); }