Exemple #1
0
        public void TestMethod()
        {
            var     t = new TestWrapper();
            dynamic w = new DynamicProxy(t);

            string r = w.Name;

            Assert.Equal("Test", r);

            r = w.Internal;
            Assert.Equal("InternalTest", r);

            r = w.Private;
            Assert.Equal("PrivateTest", r);

            r = w.EchoPublic("Tester");
            Assert.Equal("Public: Tester", r);

            r = w.EchoPrivate("Tester");
            Assert.Equal("Private: Tester", r);

            r = w.EchoInternal("Tester");
            Assert.Equal("Internal: Tester", r);

            r = w.EchoInternal(null);
            Assert.Equal("Internal: ", r);
        }