Ejemplo n.º 1
0
        public void TestInt16BackCoverterForIllegal(string inputValue, string format)
        {
            var varInfo = new Int16DataValue(new DataValue(new Variant((Int16)0)));

            varInfo.FormatSelectedItem = format;
            Assert.ThrowsException <OverflowException>(() => varInfo.ConvertValueBack(inputValue));
        }
Ejemplo n.º 2
0
        public void TestInt16BackCoverter(string inputValue, string format, Int16 expectedDisplayValue)
        {
            var varInfo = new Int16DataValue(new DataValue(new Variant((Int16)0)));

            varInfo.FormatSelectedItem = format;
            varInfo.ConvertValueBack(inputValue);
            Assert.AreEqual(varInfo.GetRawValue(), expectedDisplayValue);
        }
Ejemplo n.º 3
0
        public void TestInt16Coverter(Int16 inputValue, string format, string expectedDisplayValue)
        {
            var varInfo = new Int16DataValue(new DataValue(new Variant(inputValue)));

            varInfo.FormatSelectedItem = format;
            var convVal = varInfo.ConvertValue();

            Assert.AreEqual(convVal, expectedDisplayValue);
        }