Beispiel #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));
        }
Beispiel #2
0
        public void TestInvokeDoNotExposePrivateMethod()
        {
            var tTest   = new TestWithPrivateMethod();
            var context = InvokeContext.CreateContext;

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

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

            Assert.That((object)Dynamic.InvokeMember(tTest, "Test"), Is.EqualTo(3));
        }
Beispiel #5
0
 public void TestInvokePrivateMethod()
 {
     var tTest = new TestWithPrivateMethod();
     Assert.That(Dynamic.InvokeMember(tTest, "Test"), Is.EqualTo(3));
 }
Beispiel #6
0
 public void TestInvokeDoNotExposePrivateMethod()
 {
     var tTest = new TestWithPrivateMethod();
     var context = InvokeContext.CreateContext;
     Assert.That(() => Dynamic.InvokeMember(context(tTest,this), "Test"), Throws.InstanceOf<RuntimeBinderException>());
 }
Beispiel #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));
 }
Beispiel #8
0
 public void TestCacheableDoNotExposePrivateMethod()
 {
     var tTest = new TestWithPrivateMethod();
     var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test");
     Assert.That(() => tCachedInvoke.Invoke(tTest), Throws.InstanceOf<RuntimeBinderException>());
 }