ThisToThat/ThisToThatTests/ToDoubleTests.cs
/// <summary>
/// Makes multiple String to DoubleNullable conversions and asserts that the results are correct.
/// </summary>
Makes multiple String to DoubleNullable conversions and asserts that the results are correct.
Makes multiple String to DoubleNullable conversions and asserts that the results are correct .
[TestMethod, TestCategory("ToDouble tests")]
        public void TestStringToDoubleNullable()
        {
            Double? resultMin = "-1.7976931348623157E+308".ToDoubleNullable();
            Assert.AreEqual(-1.7976931348623157E+308d, resultMin);
            Double? result42 = "42".ToDoubleNullable();
            Assert.AreEqual(42d, result42);
            Double? resultMax = "1.7976931348623157E+308".ToDoubleNullable();
            Assert.AreEqual(1.7976931348623157E+308d, resultMax);
            Double? resultFoo = "foo".ToDoubleNullable();
            Assert.IsNull(resultFoo);
        }
[ TestMethod , TestCategory ( " " ) ] public void TestStringToDoubleNullable ( ) { Double ? resultMin = " " . ToDoubleNullable ( ) ; Assert . AreEqual ( - 1.7976931348623157E+308d , resultMin ) ; Double ? result42 = " " . ToDoubleNullable ( ) ; Assert . AreEqual ( 42d , result42 ) ; Double ? resultMax = " " . ToDoubleNullable ( ) ; Assert . AreEqual ( 1.7976931348623157E+308d , resultMax ) ; Double ? resultFoo = " " . ToDoubleNullable ( ) ; Assert . IsNull ( resultFoo ) ; }
Makes multiple String to DoubleNullable conversions and asserts that the results are correct.
Makes multiple String to DoubleNullable 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"