public void TestCacheableDoNotExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test"); AssertException <RuntimeBinderException>(() => tCachedInvoke.Invoke(tTest)); }
public void TestCacheableExposePrivateMethodViaType() { var tTest = new TestWithPrivateMethod(); var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test", context: typeof(TestWithPrivateMethod)); Assert.AreEqual(3, tCachedInvoke.Invoke(tTest)); }
public void TestDoNotExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); var tNonExposed = tTest.WithContext(this).ActLike <IExposePrivateMethod>(); AssertException <RuntimeBinderException>(() => tNonExposed.Test()); }
public void TestExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); var tExposed = tTest.ActLike <IExposePrivateMethod>(); Assert.AreEqual(3, tExposed.Test()); }
public void TestCacheableExposePrivateMethodViaType() { var tTest = new TestWithPrivateMethod(); var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test", context:typeof(TestWithPrivateMethod)); Assert.AreEqual(3, tCachedInvoke.Invoke(tTest)); }
public void TestCacheableDoNotExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); var tCachedInvoke = new CacheableInvocation(InvocationKind.InvokeMember, "Test"); AssertException<RuntimeBinderException>(() => tCachedInvoke.Invoke(tTest)); }
public void TestInvokeDoNotExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); AssertException<RuntimeBinderException>(() => Impromptu.InvokeMember(tTest.WithContext(this), "Test")); }
public void TestInvokePrivateMethod() { var tTest = new TestWithPrivateMethod(); Assert.AreEqual(3, Impromptu.InvokeMember(tTest,"Test")); }
public void TestDoNotExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); var tNonExposed = tTest.WithContext(this).ActLike<IExposePrivateMethod>(); AssertException<RuntimeBinderException>(() => tNonExposed.Test()); }
public void TestExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); var tExposed = tTest.ActLike<IExposePrivateMethod>(); Assert.AreEqual(3, tExposed.Test()); }
public void TestInvokeDoNotExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); AssertException <RuntimeBinderException>(() => Impromptu.InvokeMember(tTest.WithContext(this), "Test")); }
public void TestInvokePrivateMethod() { var tTest = new TestWithPrivateMethod(); Assert.AreEqual(3, Impromptu.InvokeMember(tTest, "Test")); }
public void TestInvokeDoNotExposePrivateMethod() { var tTest = new TestWithPrivateMethod(); AssertException <RuntimeBinderException>(() => Dynamic.InvokeMember(new InvokeContext(tTest, this), "Test")); }