public void JetLsToStringFormat() { var value = new JET_LS { Value = (IntPtr)0x123ABC }; Assert.AreEqual("123ABC", string.Format("{0:X}", value)); }
public void JetLsToString() { var handle = new JET_LS { Value = (IntPtr)0x123ABC }; Assert.AreEqual("JET_LS(0x123abc)", handle.ToString()); }
public void SetAndGetLs() { JET_LS expected = new JET_LS { Value = new IntPtr(8) }; JET_LS actual; Api.JetSetLS(this.sesid, this.tableid, expected, LsGrbit.Cursor); Api.JetGetLS(this.sesid, this.tableid, out actual, LsGrbit.Cursor); }
public void JetLsToStringGeneralFormat() { var value = new JET_LS { Value = (IntPtr)0x123ABC }; VerifyIFormattableGeneralEqualsToString(value); }
public void VerifyRuntimeCallbackIsCalled() { var ls = new JET_LS { Value = new IntPtr(8) }; Api.JetSetLS(this.sesid, this.tableid, ls, LsGrbit.Cursor); Api.JetCloseTable(this.sesid, this.tableid); Assert.IsTrue(this.runtimeCallbackWasCalled); }
public void VerifyJetLsInequality() { var x = JET_LS.Nil; var y = new JET_LS { Value = (IntPtr)0x7 }; TestUnequalObjects(x, y); Assert.IsTrue(x != y); Assert.IsFalse(x == y); }
public void VerifyJetlsIsInvalidWorksAsExpected() { var zero = JET_LS.Nil; var minusOne = new JET_LS() { Value = new IntPtr(~0) }; var shouldBeValid = new JET_LS() { Value = new IntPtr(4) }; Assert.IsTrue(zero.IsInvalid); Assert.IsTrue(minusOne.IsInvalid); Assert.IsFalse(shouldBeValid.IsInvalid); }
/// <summary> /// Enables the application to retrieve the context handle known /// as Local Storage that is associated with a cursor or the table /// associated with that cursor. This context handle must have been /// previously set using <see cref="JetSetLS"/>. JetGetLS can also /// be used to simultaneously fetch the current context handle for /// a cursor or table and reset that context handle. /// </summary> /// <param name="sesid">The session to use.</param> /// <param name="tableid">The cursor to use.</param> /// <param name="ls">Returns the retrieved context handle.</param> /// <param name="grbit">Retrieve options.</param> public static void JetGetLS(JET_SESID sesid, JET_TABLEID tableid, out JET_LS ls, LsGrbit grbit) { Api.Check(Impl.JetGetLS(sesid, tableid, out ls, grbit)); }
public void JetLsToStringFormat() { var value = new JET_LS { Value = (IntPtr)0x123ABC }; Assert.AreEqual("123ABC", String.Format("{0:X}", value)); }