public void Convert_6_Digit_Words(string num, int expected, string message) { WordsToNumbers ntw = new WordsToNumbers(); int actual = ntw.Convert(num); Assert.AreEqual(expected, actual, message); }
public void SendingZeroReturns0() { WordsToNumbers zeroConversion = new WordsToNumbers(); int actual = zeroConversion.Convert("zero"); Assert.AreEqual(0, actual, "zero returns 0"); }
public void WordsToNumbersMethodTest() { WordsToNumbers thisTest = new WordsToNumbers(); Assert.AreEqual(0, thisTest.OutputInts("zero")); Assert.AreEqual(75, thisTest.OutputInts("seventy five")); Assert.AreEqual(332, thisTest.OutputInts("three hundred and thirty two")); Assert.AreEqual(2406, thisTest.OutputInts("two thousand, four hundred and six")); Assert.AreEqual(72897, thisTest.OutputInts("seventy two thousand, eight hundred and ninety seven")); Assert.AreEqual(551701, thisTest.OutputInts("five hundred and fifty one thousand, seven hundred and one")); Assert.AreEqual(7, thisTest.OutputInts("seven")); Assert.AreEqual(12, thisTest.OutputInts("twelve")); Assert.AreEqual(22, thisTest.OutputInts("twenty two")); }