Ejemplo n.º 1
0
        public static void DynamicInvoke_SizePreservingNonVauePreservingConversion_ThrowsArgumentException()
        {
            Delegate d = new IntIntDelegate(IntIntMethod);

            AssertExtensions.Throws <ArgumentException>(null, () => d.DynamicInvoke(7, (uint)7));
            AssertExtensions.Throws <ArgumentException>(null, () => d.DynamicInvoke(7, U4.Seven));
        }
Ejemplo n.º 2
0
 public void M701(IntIntDelegate d)
 {
     Flag.Value = d(10);
 }
Ejemplo n.º 3
0
        // delegate
        public void M700(Delegate arg)
        {
            IntIntDelegate d = (IntIntDelegate)arg;

            Flag.Value = d(10);
        }
Ejemplo n.º 4
0
        [InlineData(7, ShortEnum.Seven)] // Enum (short) -> int
        public static void DynamicInvoke_ValuePreservingPrimitiveWidening_Succeeds(object o1, object o2)
        {
            Delegate d = new IntIntDelegate(IntIntMethod);

            d.DynamicInvoke(o1, o2);
        }
Ejemplo n.º 5
0
        public static void DynamicInvoke_MissingTypeForNonDefaultParameter_ThrowsArgumentException()
        {
            Delegate d = new IntIntDelegate(IntIntMethod);

            AssertExtensions.Throws <ArgumentException>("parameters", () => d.DynamicInvoke(7, Type.Missing));
        }
Ejemplo n.º 6
0
 public static void DynamicInvoke_SizePreservingNonVauePreservingConversion_ThrowsArgumentException()
 {
     Delegate d = new IntIntDelegate(IntIntMethod);
     Assert.Throws<ArgumentException>(null, () => d.DynamicInvoke(7, (uint)7));
     Assert.Throws<ArgumentException>(null, () => d.DynamicInvoke(7, U4.Seven));
 }
Ejemplo n.º 7
0
 [InlineData(7, ShortEnum.Seven)] // Enum (short) -> int
 public static void DynamicInvoke_ValuePreservingPrimitiveWidening_Succeeds(object o1, object o2)
 {
     Delegate d = new IntIntDelegate(IntIntMethod);
     d.DynamicInvoke(o1, o2);
 }
Ejemplo n.º 8
0
 public static void DynamicInvoke_MissingTypeForNonDefaultParameter_ThrowsArgumentException()
 {
     Delegate d = new IntIntDelegate(IntIntMethod);
     Assert.Throws<ArgumentException>("parameters", () => d.DynamicInvoke(7, Type.Missing));
 }