示例#1
0
        public void WhenCentsIsMoreThan2DecimalPlaceThanThrowArgumentException()
        {
            var exceptionReceived =
                Assert.Throws <ArgumentException>(() => MoneyToWordsConverter.ToEnglishWords("0.001"));

            Assert.Equal("Input contains more than 2 decimal places", exceptionReceived.Message);
        }
示例#2
0
        public void WhenInvalidInputMoneyStringThenThrowsCorrectException(string inputMoney)
        {
            var exceptionReceived =
                Assert.Throws <ArgumentOutOfRangeException>(() => MoneyToWordsConverter.ToEnglishWords(inputMoney));

            Assert.StartsWith($"Input value is out of range.", exceptionReceived.Message);
        }
示例#3
0
        public void WhenInvalidInputStringThenThrowsCorrectException(string inputMoney)
        {
            var exceptionReceived =
                Assert.Throws <ArgumentException>(() => MoneyToWordsConverter.ToEnglishWords(inputMoney));

            Assert.Equal($"Unable to parse input value.", exceptionReceived.Message);
        }
示例#4
0
 public void CanConvertValidMoneyStringToEnglishTextCorrectly(string inputMoney, string outputText)
 {
     Assert.Equal(outputText, MoneyToWordsConverter.ToEnglishWords(inputMoney));
 }