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