public void CreateInstance_ClassWithConstraintGenericMethod_HasSameBehavior() { var handler = ProxyTestHandlers.WriteMethodAndInvokeBaseHandler; var proxy = new DirectProxyFactory <ListCreator <object> >(handler).CreateInstance(); Assert.IsNotNull(proxy.Create <List <object> >()); }
public void CreateInstance_ClassWithByRefReturnMethod_HasSameBehavior() { var handler = ProxyTestHandlers.WriteMethodAndInvokeBaseHandler; var proxy = new DirectProxyFactory <ByRefValueBox <int> >(handler).CreateInstance(); Assert.AreEqual(0, proxy.Value); ref var value = ref proxy.RefValue;
public void CreateInstance_AbstractClass_GetDefaultResult() { var handler = ProxyTestHandlers.WriteMethodAndReturnDefaultHandler; var proxy = new DirectProxyFactory <EqualityComparer <object> >(handler).CreateInstance(); Assert.AreEqual(false, proxy.Equals(0, 0)); }
public void CreateInstance_ClassWithGenericMethod_HasSameBehavior() { var handler = ProxyTestHandlers.WriteMethodAndInvokeBaseHandler; var proxy = new DirectProxyFactory <Creator>(handler).CreateInstance(); Assert.IsNotNull(proxy.Create <object>()); Assert.IsTrue(proxy.Equals(proxy)); }
public void CreateInstance_ClassWithByRefParameterMethod_HasSameBehavior() { var handler = ProxyTestHandlers.WriteMethodAndInvokeBaseHandler; var proxy = new DirectProxyFactory <Int32Increaser>(handler).CreateInstance(); var value = 0; proxy.Increase(ref value); Assert.AreEqual(1, value); }
public void CreateInstance_Interface_GetDefaultResult() { var handler = ProxyTestHandlers.WriteMethodAndReturnDefaultHandler; var proxy = new DirectProxyFactory <IList <object> >(handler).CreateInstance(); Assert.AreEqual(0, proxy.Count); for (int index = 0; index < 10; index++) { Assert.AreEqual(null, proxy[index]); } }
public void CreateInstance_Class_HasSameBehavior() { var handler = ProxyTestHandlers.WriteMethodAndInvokeBaseHandler; var proxy = new DirectProxyFactory <Collection <int> >(handler).CreateInstance(); for (int index = 0; index < 10; index++) { proxy.Add(index); } Assert.AreEqual(10, proxy.Count); }