Exemplo n.º 1
0
        public void TestConvertEnumColumnidCheckThrowsExceptionWhenRgtagSequenceIsUnexpectedNull()
        {
            var managed = new JET_ENUMCOLUMNID
            {
                columnid = new JET_COLUMNID { Value = 1 },
                ctagSequence = 1,
                rgtagSequence = null,
            };

            managed.CheckDataSize();
        }
Exemplo n.º 2
0
        public void TestConvertEnumColumnidCheckThrowsExceptionWhenCTagsSequenceIsTooLong()
        {
            var managed = new JET_ENUMCOLUMNID
            {
                columnid = new JET_COLUMNID { Value = 1 },
                ctagSequence = 3,
                rgtagSequence = new int[2],
            };

            managed.CheckDataSize();
        }
Exemplo n.º 3
0
        public void TestConvertEnumColumnidCheckThrowsExceptionWhenCTagsSequenceIsNegative()
        {
            var managed = new JET_ENUMCOLUMNID
            {
                columnid = new JET_COLUMNID { Value = 1 },
                ctagSequence = -1,
                rgtagSequence = null,
            };

            managed.CheckDataSize();
        }
Exemplo n.º 4
0
 public static JET_wrn JetEnumerateColumns(
     JET_SESID sesid,
     JET_TABLEID tableid,
     int numColumnids,
     JET_ENUMCOLUMNID[] columnids,
     out int numColumnValues,
     out JET_ENUMCOLUMN[] columnValues,
     JET_PFNREALLOC allocator,
     IntPtr allocatorContext,
     int maxDataSize,
     EnumerateColumnsGrbit grbit)
 {
     return Api.Check(
         Impl.JetEnumerateColumns(
             sesid,
             tableid,
             numColumnids,
             columnids,
             out numColumnValues,
             out columnValues,
             allocator,
             allocatorContext,
             maxDataSize,
             grbit));
 }
Exemplo n.º 5
0
 public void JetEnumerateColumnsThrowsExceptionWhenNumColumnidsIsTooLong()
 {
     int numColumnValues;
     JET_ENUMCOLUMN[] columnValues;
     JET_PFNREALLOC allocator = (context, pv, cb) => IntPtr.Zero;
     var columnids = new JET_ENUMCOLUMNID[2];
     Api.JetEnumerateColumns(
         this.sesid,
         this.tableid,
         columnids.Length + 1,
         columnids,
         out numColumnValues,
         out columnValues,
         allocator,
         IntPtr.Zero,
         0,
         EnumerateColumnsGrbit.None);
 }
Exemplo n.º 6
0
        public void TestConvertEnumColumnidToNativeWithNoTags()
        {
            var managed = new JET_ENUMCOLUMNID
            {
                columnid = new JET_COLUMNID { Value = 1 },
                ctagSequence = 0,
                rgtagSequence = null,
            };

            var native = managed.GetNativeEnumColumnid();
            Assert.AreEqual<uint>(1, native.columnid);
            Assert.AreEqual<uint>(0, native.ctagSequence);
            unsafe
            {
                Assert.IsTrue(null == native.rgtagSequence);
            }
        }
Exemplo n.º 7
0
 public void JetEnumcolumnidToString()
 {
     var value = new JET_ENUMCOLUMNID { columnid = new JET_COLUMNID { Value = 27 } };
     Assert.AreEqual("JET_ENUMCOLUMNID(0x1b)", value.ToString());
 }