コード例 #1
0
        public void VerifyJetSetcolumnInequality()
        {
            var setcolumns = new JET_SETCOLUMN[10];

            for (int i = 0; i < setcolumns.Length; ++i)
            {
                setcolumns[i] = new JET_SETCOLUMN
                {
                    cbData   = 6,
                    columnid = new JET_COLUMNID {
                        Value = 1
                    },
                    err          = JET_wrn.Success,
                    grbit        = SetColumnGrbit.None,
                    ibData       = 0,
                    ibLongValue  = 0,
                    itagSequence = 1,
                    pvData       = BitConverter.GetBytes(0xBADF00DL)
                };
            }

            int j = 1;

            setcolumns[j++].cbData++;
            setcolumns[j++].columnid = JET_COLUMNID.Nil;
            setcolumns[j++].err      = JET_wrn.ColumnTruncated;
            setcolumns[j++].grbit    = SetColumnGrbit.UniqueMultiValues;
            setcolumns[j++].ibData++;
            setcolumns[j++].ibLongValue++;
            setcolumns[j++].itagSequence++;
            setcolumns[j++].pvData = BitConverter.GetBytes(1L);
            setcolumns[j++]        = new JET_SETCOLUMN();
            Debug.Assert(j == setcolumns.Length, "Didn't fill in all entries of setcolumns");
            VerifyAll(setcolumns);
        }
コード例 #2
0
        public void VerifyCheckDataSizeThrowsExceptionWhenIbDataIsNonZeroAndPvDataIsNull()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                ibData = 1,
            };

            setcolumn.CheckDataSize();
        }
コード例 #3
0
        public void VerifyCheckDataSizeThrowsExceptionWhenItagSequenceIsNegative()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                itagSequence = -1,
            };

            setcolumn.CheckDataSize();
        }
コード例 #4
0
        public void VerifyValidateThrowsExceptionWhenItagSequenceIsNegative()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                itagSequence = -1,
            };

            setcolumn.Validate();
        }
コード例 #5
0
        public void VerifyCheckDataSizeThrowsExceptionWhenIbLongValueIsNegative()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                ibLongValue = -1,
            };

            setcolumn.CheckDataSize();
        }
コード例 #6
0
        public void VerifyValidateThrowsExceptionWhenIbLongValueIsNegative()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                ibLongValue = -1,
            };

            setcolumn.Validate();
        }
コード例 #7
0
        public void VerifyValidateThrowsExceptionWhenPvDataIsNull()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                cbData = 1,
            };

            setcolumn.Validate();
        }
コード例 #8
0
        public void VerifyCheckThrowsExceptionWhenPvDataIsNull()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                cbData = 1,
            };

            setcolumn.CheckDataSize();
        }
コード例 #9
0
        public void VerifyCheckDataSizeThrowsExceptionWhenCbDataIsTooLong()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                cbData = 100,
                pvData = new byte[9],
            };

            setcolumn.CheckDataSize();
        }
コード例 #10
0
        public void VerifyCheckDataSizeThrowsExceptionWhenIbDataIsNegative()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                ibData = -1,
                pvData = new byte[1],
            };

            setcolumn.CheckDataSize();
        }
コード例 #11
0
        public void JetSetColumnToString()
        {
            var value = new JET_SETCOLUMN {
                columnid = new JET_COLUMNID {
                    Value = 0x1234F
                }
            };

            Assert.AreEqual("JET_SETCOLUMN(0x1234f,<null>,ibLongValue=0,itagSequence=0)", value.ToString());
        }
コード例 #12
0
        public void VerifyValidateThrowsExceptionWhenCbDataIsNegative()
        {
            var setcolumn = new JET_SETCOLUMN
            {
                cbData = -1,
                pvData = new byte[1],
            };

            setcolumn.Validate();
        }
コード例 #13
0
        public void VerifyJetSetcolumnEquality()
        {
            var x = new JET_SETCOLUMN {
                cbData = 4, pvData = BitConverter.GetBytes(99)
            };
            var y = new JET_SETCOLUMN {
                cbData = 4, pvData = BitConverter.GetBytes(99)
            };

            TestContentEquals(x, y);
        }
コード例 #14
0
 public void Setup()
 {
     this.managed = new JET_SETCOLUMN
     {
         cbData   = 1,
         columnid = new JET_COLUMNID {
             Value = 2
         },
         grbit        = SetColumnGrbit.AppendLV,
         ibLongValue  = 3,
         itagSequence = 4,
     };
     this.native = this.managed.GetNativeSetcolumn();
 }