public void CanHandleInvalidValue()
        {
            var converterServiceMock = new Mock <IConvertNumberToCurrencyText>();

            var obj = new DollarNumberToTextConverter(converterServiceMock.Object);

            Assert.ThrowsException <ArgumentException>(() => obj.Convert("foo"));
        }
        public void CanConvertMaxValue()
        {
            string expectedResult = "nine hundred ninety-nine million nine hundred ninety-nine thousand nine hundred ninety-nine dollars and ninety-nine cents";

            var converterServiceMock = new Mock <IConvertNumberToCurrencyText>();

            converterServiceMock.Setup(x => x.GetTextRepresentation(999999999.99M, It.IsAny <ICurrencyInfo>())).Returns(expectedResult);

            var    obj    = new DollarNumberToTextConverter(converterServiceMock.Object);
            string result = obj.Convert("999 999 999,99");

            Assert.AreEqual(expectedResult, result);
        }
        public void CanConvertMinValue()
        {
            string expectedResult = "zero dollars";

            var converterServiceMock = new Mock <IConvertNumberToCurrencyText>();

            converterServiceMock.Setup(x => x.GetTextRepresentation(0, It.IsAny <ICurrencyInfo>())).Returns(expectedResult);

            var    obj    = new DollarNumberToTextConverter(converterServiceMock.Object);
            string result = obj.Convert("0");

            Assert.AreEqual(expectedResult, result);
        }