Beispiel #1
0
        public void TestByteBackCoverterForIllegal(string inputValue, string format)
        {
            var varInfo = new ByteVariableInfo();

            varInfo.FormatSelectedItem = format;
            var wVal = varInfo.Value;

            Assert.ThrowsException <OverflowException>(() => wVal.ConvertBack(inputValue));
        }
Beispiel #2
0
        public void TestByteBackCoverter(string inputValue, string format, byte expectedDisplayValue)
        {
            var varInfo = new ByteVariableInfo();

            varInfo.FormatSelectedItem = format;
            var wVal    = varInfo.Value;
            var convVal = (WrappedValue <byte>)wVal.ConvertBack(inputValue);

            Assert.AreEqual(convVal.Value, expectedDisplayValue);
        }
Beispiel #3
0
        public void TestByteCoverter(byte inputValue, string format, string expectedDisplayValue)
        {
            var varInfo = new ByteVariableInfo();

            varInfo.FormatSelectedItem = format;
            var wVal = varInfo.Value;

            wVal.Value = inputValue;
            var convVal = wVal.Convert();

            Assert.AreEqual(convVal, expectedDisplayValue);
        }