示例#1
0
        public static void DynamicInvoke_TypeDoesntExactlyMatchRefValueType_ThrowsArgumentException()
        {
            Delegate d = new RefIntDelegate(RefIntMethod);

            AssertExtensions.Throws <ArgumentException>(null, () => d.DynamicInvoke((uint)7));
            AssertExtensions.Throws <ArgumentException>(null, () => d.DynamicInvoke(IntEnum.One));
        }
示例#2
0
        public static void DynamicInvoke_RefValueTypeParameter(object[] args, object[] expected)
        {
            Delegate d = new RefIntDelegate(RefIntMethod);

            d.DynamicInvoke(args);
            Assert.Equal(expected, args);
        }
示例#3
0
 public static void DynamicInvoke_TypeDoesntExactlyMatchRefValueType_ThrowsArgumentException()
 {
     Delegate d = new RefIntDelegate(RefIntMethod);
     Assert.Throws<ArgumentException>(null, () => d.DynamicInvoke((uint)7));
     Assert.Throws<ArgumentException>(null, () => d.DynamicInvoke(IntEnum.One));
 }
示例#4
0
 public static void DynamicInvoke_RefValueTypeParameter(object[] args, object[] expected)
 {
     Delegate d = new RefIntDelegate(RefIntMethod);
     d.DynamicInvoke(args);
     Assert.Equal(expected, args);
 }