ThisToThat/ThisToThatTests/ToDecimalTests.cs
/// <summary>
/// Makes multiple String to Decimal or default conversions and asserts that the results are correct.
/// </summary>
Makes multiple String to Decimal or default conversions and asserts that the results are correct.
Makes multiple String to Decimal or default conversions and asserts that the results are correct .
[TestMethod, TestCategory("ToDecimal tests")]
        public void TestStringToDecimalOrDefault()
        {
            Decimal resultMin = "-79228162514264337593543950335".ToDecimalOrDefault();
            Assert.AreEqual(-79228162514264337593543950335m, resultMin);
            Decimal result42 = "42".ToDecimalOrDefault();
            Assert.AreEqual(42m, result42);
            Decimal resultMax = "79228162514264337593543950335".ToDecimalOrDefault();
            Assert.AreEqual(79228162514264337593543950335m, resultMax);
            Decimal resultFoo = "foo".ToDecimalOrDefault(86m);
            Assert.AreEqual(86m, resultFoo);
        }
[ TestMethod , TestCategory ( " " ) ] public void TestStringToDecimalOrDefault ( ) { Decimal resultMin = " " . ToDecimalOrDefault ( ) ; Assert . AreEqual ( - 79228162514264337593543950335m , resultMin ) ; Decimal result42 = " " . ToDecimalOrDefault ( ) ; Assert . AreEqual ( 42m , result42 ) ; Decimal resultMax = " " . ToDecimalOrDefault ( ) ; Assert . AreEqual ( 79228162514264337593543950335m , resultMax ) ; Decimal resultFoo = " " . ToDecimalOrDefault ( 86m ) ; Assert . AreEqual ( 86m , resultFoo ) ; }
Makes multiple String to Decimal or default conversions and asserts that the results are correct.
Makes multiple String to Decimal or default conversions and asserts that the results are correct .
// Test conversion of target type minimum value // Test conversion of fixed value (42) // Test conversion of target type maximum value // Test conversion of "foo"