SetFromNativeEnumColumn() private method

Sets the fields of the object from a native JET_ENUMCOLUMN struct.
private SetFromNativeEnumColumn ( NATIVE_ENUMCOLUMN value ) : void
value NATIVE_ENUMCOLUMN /// The native enumcolumn to set the values from. ///
return void
Exemplo n.º 1
0
        public void TestSingleValueConversion()
        {
            var native = new NATIVE_ENUMCOLUMN
            {
                columnid = 1,
                err = (int) JET_wrn.ColumnSingleValue,
                cbData = 3,
                pvData = new IntPtr(4),
            };

            var managed = new JET_ENUMCOLUMN();
            managed.SetFromNativeEnumColumn(native);

            Assert.AreEqual<uint>(1, managed.columnid.Value);
            Assert.AreEqual(JET_wrn.ColumnSingleValue, managed.err);
            Assert.AreEqual(3, managed.cbData);
            Assert.AreEqual(new IntPtr(4), managed.pvData);
        }
Exemplo n.º 2
0
        public void TestMultiValueConversion()
        {
            var managed = new JET_ENUMCOLUMN();
            unsafe
            {
                var columnvalues = stackalloc NATIVE_ENUMCOLUMNVALUE[2];
                var native = new NATIVE_ENUMCOLUMN
                {
                    columnid = 1,
                    err = (int) JET_wrn.Success,
                    cEnumColumnValue = 3,
                    rgEnumColumnValue = columnvalues,
                };

                managed.SetFromNativeEnumColumn(native);                
            }

            Assert.AreEqual<uint>(1, managed.columnid.Value);
            Assert.AreEqual(JET_wrn.Success, managed.err);
            Assert.AreEqual(3, managed.cEnumColumnValue);
            Assert.AreEqual(null, managed.rgEnumColumnValue);
        }