Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public void WhenInvalidInputStringThenThrowsCorrectException(string inputMoney)
        {
            var exceptionReceived =
                Assert.Throws <ArgumentException>(() => MoneyToWordsConverter.ToEnglishWords(inputMoney));

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