public void TestDelegates() { var delegates = new TestDelegates(); var doubleSum = delegates.A(2) + delegates.B(2); Assert.AreEqual(8, doubleSum); var stdcall = delegates.StdCall(i => i); Assert.AreEqual(1, stdcall); var cdecl = delegates.CDecl(i => i); Assert.AreEqual(1, cdecl); }
public void TestDelegates() { using (var delegates = new TestDelegates()) { var doubleSum = delegates.A(2) + delegates.B(2); Assert.AreEqual(8, doubleSum); var stdcall = delegates.StdCall(i => i); Assert.AreEqual(1, stdcall); var cdecl = delegates.CDecl(i => i); Assert.AreEqual(1, cdecl); var emptydelegeate = delegates.MarshalNullDelegate; Assert.AreEqual(emptydelegeate, null); } }
public void TestDelegates() { var delegates = new TestDelegates(); var doubleSum = delegates.A(2) + delegates.B(2); Assert.AreEqual(8, doubleSum); }