ThisToThat/ThisToThatTests/ToInt16Tests.cs
/// <summary>
/// Makes multiple String to Int16 or default conversions and asserts that the results are correct.
/// </summary>
Makes multiple String to Int16 or default conversions and asserts that the results are correct.
Makes multiple String to Int16 or default conversions and asserts that the results are correct .
[TestMethod, TestCategory("ToInt16 tests")]
        public void TestStringToInt16OrDefault()
        {
            Int16 resultMin = "-32768".ToInt16OrDefault();
            Assert.AreEqual((short)-32768, resultMin);
            Int16 result42 = "42".ToInt16OrDefault();
            Assert.AreEqual((short)42, result42);
            Int16 resultMax = "32767".ToInt16OrDefault();
            Assert.AreEqual((short)32767, resultMax);
            Int16 resultFoo = "foo".ToInt16OrDefault((short)86);
            Assert.AreEqual((short)86, resultFoo);
        }
[ TestMethod , TestCategory ( " " ) ] public void TestStringToInt16OrDefault ( ) { Int16 resultMin = " " . ToInt16OrDefault ( ) ; Assert . AreEqual ( ( short ) - 32768 , resultMin ) ; Int16 result42 = " " . ToInt16OrDefault ( ) ; Assert . AreEqual ( ( short ) 42 , result42 ) ; Int16 resultMax = " " . ToInt16OrDefault ( ) ; Assert . AreEqual ( ( short ) 32767 , resultMax ) ; Int16 resultFoo = " " . ToInt16OrDefault ( ( short ) 86 ) ; Assert . AreEqual ( ( short ) 86 , resultFoo ) ; }
Makes multiple String to Int16 or default conversions and asserts that the results are correct.
Makes multiple String to Int16 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"