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