public void ThrowArgumentNullException_WhenPassedValueIsNull() { var parser = new DecimalParser(); string input = null; Assert.Throws <ArgumentNullException>(() => parser.ParseDecimal(input)); }
public void ReturnCorrectValueRegardlessOfFormat_WhenValidStringPassed(string input) { var parser = new DecimalParser(); var result = parser.ParseDecimal(input); Assert.AreEqual(10566.01m, result); }
public void ReturnCorrectValue_WhenContentOfPassedStringIsWholeNumber() { var parser = new DecimalParser(); string input = "424"; var result = parser.ParseDecimal(input); Assert.AreEqual(424, result); }
public void ThrowArgumentException_WhenPassedValueIsWhiteSpaceOrEmptyString(string input) { var parser = new DecimalParser(); Assert.Throws <ArgumentException>(() => parser.ParseDecimal(input)); }