Esempio n. 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);
    }
Esempio n. 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);
        }
    }
Esempio n. 3
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);
    }
Esempio n. 4
0
 public void TestDelegates()
 {
     var delegates = new TestDelegates();
     var doubleSum = delegates.A(2) + delegates.B(2);
     Assert.AreEqual(8, doubleSum);
 }
Esempio n. 5
0
 public void TestDelegates()
 {
     var delegates = new TestDelegates();
     var doubleSum = delegates.A(2) + delegates.B(2);
     Assert.AreEqual(8, doubleSum);
 }