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