public void GetWordsFromAmount_ReturnsStringInWords() { // Arrange decimal amount = 144.20M; //Act var model = new ConvertAmountInWords(); var stringInWords = model.GetWordsFromAmount(amount); // Assert stringInWords.Should().Be("ONE HUNDRED FORTY-FOUR DOLLARS AND TWENTY CENTS"); }
public string GetAmountInWords(decimal amount) { try { // we can use structure map or any other Ioc way to inject the object ConvertAmountInWords convertAmountInWords = new ConvertAmountInWords(); return(convertAmountInWords.GetWordsFromAmount(amount)); } catch (Exception ex) { //log the error using log4net return(string.Empty); } }