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