コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }