Ejemplo n.º 1
0
        public void TestCacheableExposePrivateMethodViaType()
        {
            var tTest         = new TestWithPrivateMethod();
            var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test", context: typeof(TestWithPrivateMethod));

            Assert.That(tCachedInvoke.Invoke(tTest), Is.EqualTo(3));
        }
Ejemplo n.º 2
0
        public void TestInvokeDoNotExposePrivateMethod()
        {
            var tTest   = new TestWithPrivateMethod();
            var context = InvokeContext.CreateContext;

            Assert.That(() => Dynamic.InvokeMember(context(tTest, this), "Test"), Throws.InstanceOf <RuntimeBinderException>());
        }
Ejemplo n.º 3
0
        public void TestCacheableDoNotExposePrivateMethod()
        {
            var tTest         = new TestWithPrivateMethod();
            var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test");

            Assert.That(() => tCachedInvoke.Invoke(tTest), Throws.InstanceOf <RuntimeBinderException>());
        }
Ejemplo n.º 4
0
        public void TestInvokePrivateMethod()
        {
            var tTest = new TestWithPrivateMethod();

            Assert.That((object)Dynamic.InvokeMember(tTest, "Test"), Is.EqualTo(3));
        }
Ejemplo n.º 5
0
 public void TestInvokePrivateMethod()
 {
     var tTest = new TestWithPrivateMethod();
     Assert.That(Dynamic.InvokeMember(tTest, "Test"), Is.EqualTo(3));
 }
Ejemplo n.º 6
0
 public void TestInvokeDoNotExposePrivateMethod()
 {
     var tTest = new TestWithPrivateMethod();
     var context = InvokeContext.CreateContext;
     Assert.That(() => Dynamic.InvokeMember(context(tTest,this), "Test"), Throws.InstanceOf<RuntimeBinderException>());
 }
Ejemplo n.º 7
0
 public void TestCacheableExposePrivateMethodViaType()
 {
     var tTest = new TestWithPrivateMethod();
     var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test", context: typeof(TestWithPrivateMethod));
     Assert.That( tCachedInvoke.Invoke(tTest), Is.EqualTo(3));
 }
Ejemplo n.º 8
0
 public void TestCacheableDoNotExposePrivateMethod()
 {
     var tTest = new TestWithPrivateMethod();
     var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test");
     Assert.That(() => tCachedInvoke.Invoke(tTest), Throws.InstanceOf<RuntimeBinderException>());
 }