예제 #1
0
        public void ThrowArgumentNullException_WhenPassedValueIsNull()
        {
            var    parser = new DecimalParser();
            string input  = null;

            Assert.Throws <ArgumentNullException>(() => parser.ParseDecimal(input));
        }
예제 #2
0
        public void ReturnCorrectValueRegardlessOfFormat_WhenValidStringPassed(string input)
        {
            var parser = new DecimalParser();

            var result = parser.ParseDecimal(input);

            Assert.AreEqual(10566.01m, result);
        }
예제 #3
0
        public void ReturnCorrectValue_WhenContentOfPassedStringIsWholeNumber()
        {
            var    parser = new DecimalParser();
            string input  = "424";

            var result = parser.ParseDecimal(input);

            Assert.AreEqual(424, result);
        }
예제 #4
0
        public void ThrowArgumentException_WhenPassedValueIsWhiteSpaceOrEmptyString(string input)
        {
            var parser = new DecimalParser();

            Assert.Throws <ArgumentException>(() => parser.ParseDecimal(input));
        }