System.Tests.DelegateTests.ClosedStaticDelegate C# (CSharp) Method

ClosedStaticDelegate() private method

private ClosedStaticDelegate ( ) : void
return void
        public static void ClosedStaticDelegate()
        {
            TestClass foo = new TestClass();
            foo.structField.o1 = new object();
            foo.structField.o2 = new object();
            StructReturningDelegate testDelegate = foo.TestFunc;
            TestStruct returnedStruct = testDelegate();
            Assert.Same(foo.structField.o1, returnedStruct.o1);
            Assert.Same(foo.structField.o2, returnedStruct.o2);
        }
DelegateTests