public void TestMethodNulls()
    {
      var t = new TestWrapper();
      dynamic w = new DynamicProxy(t);

      string r = w.EchoInternal(null);
      Assert.AreEqual("Internal: ", r);

      r = w.EchoInternal2(1);
      Assert.AreEqual("Int: 1", r);
      r = w.EchoInternal2("Test");
      Assert.AreEqual("String: Test", r);

      r = w.EchoInternal2("Test", "Testing");
      Assert.AreEqual("Name: Test Value: Testing", r);

      r = w.EchoInternal2("Test", null);
      Assert.AreEqual("Name: Test Value: ", r);


      r = w.EchoInternal3("Test", "Testing", null);
      Assert.AreEqual("Name: Test Value: Testing Value2: ", r);

      r = w.EchoInternal3("Test", 1, null);
      Assert.AreEqual("Name: Test Value: 1 Value2: ", r);

    }
Exemplo n.º 2
0
        public void TestMethodNulls()
        {
            var     t = new TestWrapper();
            dynamic w = new DynamicProxy(t);

            string r = w.EchoInternal(null);

            Assert.AreEqual("Internal: ", r);

            r = w.EchoInternal2(1);
            Assert.AreEqual("Int: 1", r);
            r = w.EchoInternal2("Test");
            Assert.AreEqual("String: Test", r);

            r = w.EchoInternal2("Test", "Testing");
            Assert.AreEqual("Name: Test Value: Testing", r);

            r = w.EchoInternal2("Test", null);
            Assert.AreEqual("Name: Test Value: ", r);


            r = w.EchoInternal3("Test", "Testing", null);
            Assert.AreEqual("Name: Test Value: Testing Value2: ", r);

            r = w.EchoInternal3("Test", 1, null);
            Assert.AreEqual("Name: Test Value: 1 Value2: ", r);
        }
    public void TestMethod()
    {
      var t = new TestWrapper();
      dynamic w = new DynamicProxy(t);

      string r = w.Name;
      Assert.AreEqual("Test", r);

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

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

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

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

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

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

    }
Exemplo n.º 4
0
        public void TestMethod()
        {
            var     t = new TestWrapper();
            dynamic w = new DynamicProxy(t);

            string r = w.Name;

            Assert.AreEqual("Test", r);

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

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

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

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

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

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