コード例 #1
0
        public void TestUInt16BackCoverterForIllegal(string inputValue, string format)
        {
            var varInfo = new UInt16VariableInfo();

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

            Assert.ThrowsException <OverflowException>(() => wVal.ConvertBack(inputValue));
        }
コード例 #2
0
        public void TestUInt16BackCoverter(string inputValue, string format, UInt16 expectedDisplayValue)
        {
            var varInfo = new UInt16VariableInfo();

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

            Assert.AreEqual(convVal.Value, expectedDisplayValue);
        }
コード例 #3
0
        public void TestUInt16Coverter(UInt16 inputValue, string format, string expectedDisplayValue)
        {
            var varInfo = new UInt16VariableInfo();

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

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

            Assert.AreEqual(convVal, expectedDisplayValue);
        }