Exemplo n.º 1
0
        public void TestDelegateWithParameter()
        {
            GetLong      meth;
            IntGenerator obj = new IntGenerator();

            meth = obj.GetInteger;
            long was = meth(2);

            Assert.Equal(2, was);
            was = meth(5);
            Assert.Equal(5, was);
        }
Exemplo n.º 2
0
        public void TestDelegateFromUserClass()
        {
            GetInt       meth;
            IntGenerator obj = new IntGenerator();

            meth = obj.GetPi;
            int was = meth();

            Assert.Equal(3, was);
            meth = obj.GetE;
            was  = meth();
            Assert.Equal(2, was);
        }