public void DynamicInvoke() { dynamic d = new DynamicallyInvokableIntPower(); int pow = d(8, 9); Assert.Equal(134217728, pow); Assert.Throws <OverflowException>(() => d(int.MaxValue, int.MaxValue)); }
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")); }
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")); }
public void DynamicInvoke() { dynamic d = new DynamicallyInvokableIntPower(); int pow = d(8, 9); Assert.Equal(134217728, pow); Assert.Throws<OverflowException>(() => d(int.MaxValue, int.MaxValue)); }