Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public static void DynamicInvoke_RefValueTypeParameter(object[] args, object[] expected)
        {
            Delegate d = new RefIntDelegate(RefIntMethod);

            d.DynamicInvoke(args);
            Assert.Equal(expected, args);
        }
Exemplo n.º 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));
 }
Exemplo n.º 4
0
 public static void DynamicInvoke_RefValueTypeParameter(object[] args, object[] expected)
 {
     Delegate d = new RefIntDelegate(RefIntMethod);
     d.DynamicInvoke(args);
     Assert.Equal(expected, args);
 }