ThisToThat/ThisToThatTests/ToSByteTests.cs
/// <summary>
/// Makes multiple String to SByteNullable conversions and asserts that the results are correct.
/// </summary>
Makes multiple String to SByteNullable conversions and asserts that the results are correct.
Makes multiple String to SByteNullable conversions and asserts that the results are correct .
[TestMethod, TestCategory("ToSByte tests")]
        public void TestStringToSByteNullable()
        {
            SByte? resultMin = "-128".ToSByteNullable();
            Assert.AreEqual((sbyte)-128, resultMin);
            SByte? result42 = "42".ToSByteNullable();
            Assert.AreEqual((sbyte)42, result42);
            SByte? resultMax = "127".ToSByteNullable();
            Assert.AreEqual((sbyte)127, resultMax);
            SByte? resultFoo = "foo".ToSByteNullable();
            Assert.IsNull(resultFoo);
        }
[ TestMethod , TestCategory ( " " ) ] public void TestStringToSByteNullable ( ) { SByte ? resultMin = " " . ToSByteNullable ( ) ; Assert . AreEqual ( ( sbyte ) - 128 , resultMin ) ; SByte ? result42 = " " . ToSByteNullable ( ) ; Assert . AreEqual ( ( sbyte ) 42 , result42 ) ; SByte ? resultMax = " " . ToSByteNullable ( ) ; Assert . AreEqual ( ( sbyte ) 127 , resultMax ) ; SByte ? resultFoo = " " . ToSByteNullable ( ) ; Assert . IsNull ( resultFoo ) ; }
Makes multiple String to SByteNullable conversions and asserts that the results are correct.
Makes multiple String to SByteNullable 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"