Esempio n. 1
0
        // Call this with one or more values to self test
        public static void Test(params TypedValue[] values)
        {
            var tvbt = new TypedValueBuilderTest {
                _input = TypedValueBuilder.Create(values)
            };

            tvbt._output = TypedValueBuilder.Create(tvbt._input.DataTypes);
            tvbt.MoveData();
            var outvalues = tvbt._output.FilledValues();

            for (var i = 0; i < values.Length; ++i)
            {
                Logger.Assert(values[i].Equals(outvalues[i]), "value test");
            }
        }
Esempio n. 2
0
        // Common code for setting a value
        public void Set(TypedValue value)
        {
            Value = value;
#if false // FIX:code
            if (!(value.DataType is DataTypeCode))
            {
                //if (value.DataType != DataTypes.Code) {
                Logger.Assert(value.DataType == DataType);
                // TEMP: following code is just so it gets exercised
                NativeValue = TypeMaker.ToNativeValue(value);
                if (NativeValue != null) // TODO: CodeValue
                {
                    Value = TypeMaker.FromNativeValue(NativeValue, DataType);
                }
                TypedValueBuilderTest.Test(value);
            }
#endif
        }