示例#1
0
        public void TestCallByRef()
        {
            TestA t = new TestA();

            callByRef(ref t);
            Assert.IsTrue(5 == t.a);

            t.SetB(6);
            Assert.IsTrue(6 == t.b);

            TestA u = callWithReturnValue();

            Assert.IsTrue(7 == u.a);

            callByValue(t);
        }
示例#2
0
 void callByRef(ref TestA a)
 {
     a.a = 5;
     a.SetB(2);
 }