ThisToThat/ThisToThatTests/ToByteTests.cs
/// <summary>
/// Makes multiple String to ByteNullable conversions and asserts that the results are correct.
/// </summary>
Makes multiple String to ByteNullable conversions and asserts that the results are correct.
Makes multiple String to ByteNullable conversions and asserts that the results are correct .
[TestMethod, TestCategory("ToByte tests")]
        public void TestStringToByteNullable()
        {
            Byte? resultMin = "0".ToByteNullable();
            Assert.AreEqual((byte)0, resultMin);
            Byte? result42 = "42".ToByteNullable();
            Assert.AreEqual((byte)42, result42);
            Byte? resultMax = "255".ToByteNullable();
            Assert.AreEqual((byte)255, resultMax);
            Byte? resultFoo = "foo".ToByteNullable();
            Assert.IsNull(resultFoo);
        }
[ TestMethod , TestCategory ( " " ) ] public void TestStringToByteNullable ( ) { Byte ? resultMin = " " . ToByteNullable ( ) ; Assert . AreEqual ( ( byte ) 0 , resultMin ) ; Byte ? result42 = " " . ToByteNullable ( ) ; Assert . AreEqual ( ( byte ) 42 , result42 ) ; Byte ? resultMax = " " . ToByteNullable ( ) ; Assert . AreEqual ( ( byte ) 255 , resultMax ) ; Byte ? resultFoo = " " . ToByteNullable ( ) ; Assert . IsNull ( resultFoo ) ; }
Makes multiple String to ByteNullable conversions and asserts that the results are correct.
Makes multiple String to ByteNullable 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"