You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.
[TestClass]
public class LinFuProxyTests
{
[TestMethod]
public void CreateProxyTest()
{
var target = new SampleClass();
var factory = new ProxyFactory();
var interceptor = new SampleInterceptor(target);
var proxy = factory.CreateProxy<SampleClass>(interceptor);
}
}
public class SampleClass : ICloneable
{
object ICloneable.Clone()
{
return new SampleClass();
}
}
public class SampleInterceptor : IInvokeWrapper
{
public SampleInterceptor(object target)
{
this.Target = target;
}
public object Target { get; private set; }
object IInvokeWrapper.DoInvoke(IInvocationInfo info)
{
return null;
}
void IBeforeInvoke.BeforeInvoke(IInvocationInfo info)
{
}
void IAfterInvoke.AfterInvoke(IInvocationInfo info, object returnValue)
{
}
}
Result of the unit test is:
Test method LinFuProxyTests.CreateProxyTest threw exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at LinFu.Proxy.Interfaces.ProxyFactoryExtensions.CreateProxy(IProxyFactory factory, Type instanceType, IInterceptor interceptor, Type[] baseInterfaces)
at LinFu.Proxy.Interfaces.ProxyFactoryExtensions.CreateProxy(IProxyFactory factory, Type instanceType, IInvokeWrapper wrapper, Type[] baseInterfaces)
at LinFu.Proxy.Interfaces.ProxyFactoryExtensions.CreateProxy(IProxyFactory factory, IInvokeWrapper wrapper, Type[] baseInterfaces)
at LinFuProxyTests.CreateProxyTest() in LinFuProxyTests.cs: line 28
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The title says more or less all.
A little sample:
Result of the unit test is:
Test method LinFuProxyTests.CreateProxyTest threw exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at LinFu.Proxy.Interfaces.ProxyFactoryExtensions.CreateProxy(IProxyFactory factory, Type instanceType, IInterceptor interceptor, Type[] baseInterfaces)
at LinFu.Proxy.Interfaces.ProxyFactoryExtensions.CreateProxy(IProxyFactory factory, Type instanceType, IInvokeWrapper wrapper, Type[] baseInterfaces)
at LinFu.Proxy.Interfaces.ProxyFactoryExtensions.CreateProxy(IProxyFactory factory, IInvokeWrapper wrapper, Type[] baseInterfaces)
at LinFuProxyTests.CreateProxyTest() in LinFuProxyTests.cs: line 28
The text was updated successfully, but these errors were encountered: