public void WhenCentsIsMoreThan2DecimalPlaceThanThrowArgumentException() { var exceptionReceived = Assert.Throws <ArgumentException>(() => MoneyToWordsConverter.ToEnglishWords("0.001")); Assert.Equal("Input contains more than 2 decimal places", exceptionReceived.Message); }
public void WhenInvalidInputMoneyStringThenThrowsCorrectException(string inputMoney) { var exceptionReceived = Assert.Throws <ArgumentOutOfRangeException>(() => MoneyToWordsConverter.ToEnglishWords(inputMoney)); Assert.StartsWith($"Input value is out of range.", exceptionReceived.Message); }
public void WhenInvalidInputStringThenThrowsCorrectException(string inputMoney) { var exceptionReceived = Assert.Throws <ArgumentException>(() => MoneyToWordsConverter.ToEnglishWords(inputMoney)); Assert.Equal($"Unable to parse input value.", exceptionReceived.Message); }
public void CanConvertValidMoneyStringToEnglishTextCorrectly(string inputMoney, string outputText) { Assert.Equal(outputText, MoneyToWordsConverter.ToEnglishWords(inputMoney)); }