Ejemplo n.º 1
0
 public void NumberWorder_WhenParsingValidNumericInput_ShouldReturnParsedWording(string input,string expected)
 {
     NumberWorder numberWorder = new NumberWorder();
     var outcome = numberWorder.Parse(input);
     Assert.AreEqual(outcome, expected);
 }
Ejemplo n.º 2
0
 public void NumberWorder_WhenParsingTextWithAlphaCharacters_ShouldThrowArgumentException(string input)
 {
     NumberWorder numberWorder = new NumberWorder();            
     var ex = Assert.Catch<ArgumentException>(() => numberWorder.Parse(input));
     StringAssert.Contains(NumberWorder.NonNumericInputMessage, ex.Message);
 }
Ejemplo n.º 3
0
 public void NumberWorder_WhenParsingNullOrEmptyText_ShouldThrowArgumentException(string input)
 {
     NumberWorder numberWorder = new NumberWorder();
     var ex = Assert.Catch<ArgumentException>(() => numberWorder.Parse(input));
     StringAssert.Contains(NumberWorder.EmptyInputMessage, ex.Message);
 }