Example #1
0
    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);
    }
Example #2
0
    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);

        var stdcall = delegates.StdCall(i => i);
        Assert.AreEqual(1, stdcall);

        var cdecl = delegates.CDecl(i => i);
        Assert.AreEqual(1, cdecl);
    }
Example #4
0
 public void TestDelegates()
 {
     var delegates = new TestDelegates();
     var doubleSum = delegates.A(2) + delegates.B(2);
     Assert.AreEqual(8, doubleSum);
 }
Example #5
0
 public void TestDelegates()
 {
     var delegates = new TestDelegates();
     var doubleSum = delegates.A(2) + delegates.B(2);
     Assert.AreEqual(8, doubleSum);
 }