示例#1
0
        public void TestSByteBackCoverterForIllegal(string inputValue, string format)
        {
            var varInfo = new SByteVariableInfo();

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

            Assert.ThrowsException <OverflowException>(() => wVal.ConvertBack(inputValue));
        }
示例#2
0
        public void TestSByteBackCoverter(string inputValue, string format, sbyte expectedDisplayValue)
        {
            var varInfo = new SByteVariableInfo();

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

            Assert.AreEqual(convVal.Value, expectedDisplayValue);
        }
示例#3
0
        public void TestSByteeanVariableInfo()
        {
            var vi = new SByteVariableInfo();

            Assert.AreEqual(vi.Value.Value, 0);
            vi.WriteValue = new WrappedValue <sbyte>(-128, FormatType.DEC, null, null);

            Assert.AreEqual(vi.WriteValue.Value, -128);
            Assert.AreEqual(vi.Value.Value, -128);
        }
示例#4
0
        public void TestSByteCoverter(sbyte inputValue, string format, string expectedDisplayValue)
        {
            var varInfo = new SByteVariableInfo();

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

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

            Assert.AreEqual(convVal, expectedDisplayValue);
        }