ThisToThat/ThisToThatTests/ToUInt16Tests.cs
/// <summary>
/// Makes multiple String to UInt16Nullable conversions and asserts that the results are correct.
/// </summary>
Makes multiple String to UInt16Nullable conversions and asserts that the results are correct.
Makes multiple String to UInt16Nullable conversions and asserts that the results are correct .
[TestMethod, TestCategory("ToUInt16 tests")]
        public void TestStringToUInt16Nullable()
        {
            UInt16? resultMin = "0".ToUInt16Nullable();
            Assert.AreEqual((ushort)0, resultMin);
            UInt16? result42 = "42".ToUInt16Nullable();
            Assert.AreEqual((ushort)42, result42);
            UInt16? resultMax = "65535".ToUInt16Nullable();
            Assert.AreEqual((ushort)65535, resultMax);
            UInt16? resultFoo = "foo".ToUInt16Nullable();
            Assert.IsNull(resultFoo);
        }
[ TestMethod , TestCategory ( " " ) ] public void TestStringToUInt16Nullable ( ) { UInt16 ? resultMin = " " . ToUInt16Nullable ( ) ; Assert . AreEqual ( ( ushort ) 0 , resultMin ) ; UInt16 ? result42 = " " . ToUInt16Nullable ( ) ; Assert . AreEqual ( ( ushort ) 42 , result42 ) ; UInt16 ? resultMax = " " . ToUInt16Nullable ( ) ; Assert . AreEqual ( ( ushort ) 65535 , resultMax ) ; UInt16 ? resultFoo = " " . ToUInt16Nullable ( ) ; Assert . IsNull ( resultFoo ) ; }
Makes multiple String to UInt16Nullable conversions and asserts that the results are correct.
Makes multiple String to UInt16Nullable 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"