Ejemplo n.º 1
0
        public void can_cast_to_method_with_ref_parameter()
        {
            var target = new TargetWithOutMethod();
            var proxy  = Duck.Cast <IMethodWithRef>(target);
            int val    = 1;

            proxy.AddOne(ref val);
            Assert.AreEqual(2, val);
        }
Ejemplo n.º 2
0
        public void can_cast_to_method_with_out_parameter()
        {
            var target = new TargetWithOutMethod();
            var proxy  = Duck.Cast <IMethodWithOut>(target);
            int val;

            proxy.Execute(out val);
            Assert.AreEqual(1, val);
        }