Exemple #1
0
        public void test_InstanceInvocation()
        {
            // test by invoking itseft
            object proxy = O2AppDomainFactory.getProxy(assemblyName, typeToCreateSimpleName + " " + assemblyName);

            Assert.That(proxy != null, "proxy was null");
            // test via direct cast
            var    simpleAppDomainProxy      = (O2Proxy)proxy;
            string resultUsingDirectCall     = simpleAppDomainProxy.nameOfCurrentDomain();
            var    resultUsingReflectionCall =
                (string)simpleAppDomainProxy.instanceInvocation("O2Proxy", "nameOfCurrentDomainStatic", new object[0]);

            Assert.That(resultUsingDirectCall != null && resultUsingReflectionCall != "",
                        "direct cast : result values were null ");
            DI.log.info("{0} == {1}", resultUsingDirectCall, resultUsingReflectionCall);
            Assert.That(resultUsingDirectCall == resultUsingReflectionCall, "direct cast : return values are not equal");
        }