public void ShouldNotFailForExplicitImplementation() { var foo = new ExplicitImplementation(); IFoo fooProxy = null; Assert.DoesNotThrow(() => fooProxy = StructProxy.CreateProxyInstance <IFoo>(foo)); Assert.DoesNotThrow(() => fooProxy.Value = 1); Assert.DoesNotThrow(() => fooProxy.Compute(1, 2)); Assert.IsNotNull(fooProxy); Assert.AreSame(fooProxy, foo); }
public void ShouldNotFailForInternalType() { var foo = new InternalFoo(); IFoo fooProxy = null; Assert.DoesNotThrow(() => fooProxy = StructProxy.CreateProxyInstance <IFoo>(foo)); Assert.DoesNotThrow(() => fooProxy.Value = 1); Assert.DoesNotThrow(() => fooProxy.Compute(1, 2)); Assert.IsNotNull(fooProxy); Assert.AreSame(fooProxy, foo); }