Esempio n. 1
0
        public void DynamicInvoke()
        {
            dynamic d   = new DynamicallyInvokableIntPower();
            int     pow = d(8, 9);

            Assert.Equal(134217728, pow);
            Assert.Throws <OverflowException>(() => d(int.MaxValue, int.MaxValue));
        }
Esempio n. 2
0
        public void DynamicInvokeMismatch()
        {
            dynamic d = new DynamicallyInvokableIntPower();

            Assert.Throws <RuntimeBinderException>(() => d(9));
            Assert.Throws <RuntimeBinderException>(() => d());
            Assert.Throws <RuntimeBinderException>(() => d(1, 2, 3));
            Assert.Throws <RuntimeBinderException>(() => d("eight", "nine"));
        }
Esempio n. 3
0
 public void DynamicInvokeMismatch()
 {
     dynamic d = new DynamicallyInvokableIntPower();
     Assert.Throws<RuntimeBinderException>(() => d(9));
     Assert.Throws<RuntimeBinderException>(() => d());
     Assert.Throws<RuntimeBinderException>(() => d(1, 2, 3));
     Assert.Throws<RuntimeBinderException>(() => d("eight", "nine"));
 }
Esempio n. 4
0
 public void DynamicInvoke()
 {
     dynamic d = new DynamicallyInvokableIntPower();
     int pow = d(8, 9);
     Assert.Equal(134217728, pow);
     Assert.Throws<OverflowException>(() => d(int.MaxValue, int.MaxValue));
 }