public void DynamicInvokeMember() { dynamic d = new DynamicallyInvokableIntPowerMember(); int pow = d.Power(8, 9); Assert.Equal(134217728, pow); Assert.Throws <OverflowException>(() => d.Power(int.MaxValue, int.MaxValue)); }
public void DynamicInvokeMemberMismatch() { dynamic d = new DynamicallyInvokableIntPowerMember(); Assert.Throws <RuntimeBinderException>(() => d.Power(9)); Assert.Throws <RuntimeBinderException>(() => d.Power()); Assert.Throws <RuntimeBinderException>(() => d.Power(1, 2, 3)); Assert.Throws <RuntimeBinderException>(() => d.Power("eight", "nine")); Assert.Throws <RuntimeBinderException>(() => d.power(8, 9)); }
public void DynamicInvokeMemberMismatch() { dynamic d = new DynamicallyInvokableIntPowerMember(); Assert.Throws<RuntimeBinderException>(() => d.Power(9)); Assert.Throws<RuntimeBinderException>(() => d.Power()); Assert.Throws<RuntimeBinderException>(() => d.Power(1, 2, 3)); Assert.Throws<RuntimeBinderException>(() => d.Power("eight", "nine")); Assert.Throws<RuntimeBinderException>(() => d.power(8, 9)); }
public void DynamicInvokeMemberStaticMember() { dynamic d = new DynamicallyInvokableIntPowerMember(); int mod = d.Modulo(233, 12); Assert.Equal(5, mod); Assert.Throws<RuntimeBinderException>(() => d.Modulo(2)); Assert.Throws<RuntimeBinderException>(() => d.modulo(233, 12)); Assert.Throws<RuntimeBinderException>(() => d.Modulo()); Assert.Throws<RuntimeBinderException>(() => d.Modulo(233, 12, 9)); Assert.Throws<RuntimeBinderException>(() => d.Modulo("two hundred and thirty-three", "twelve")); }
public void DynamicInvokeMember() { dynamic d = new DynamicallyInvokableIntPowerMember(); int pow = d.Power(8, 9); Assert.Equal(134217728, pow); Assert.Throws<OverflowException>(() => d.Power(int.MaxValue, int.MaxValue)); }