public void InterfaceWithTwoMembers_InSubClass() { dynamic d = new EmptyClass(); Assert.Throws<RuntimeBinderException>(() => d.Foo()); Assert.Throws<InvalidCastException>(() => Helpers.Cast<BaseInterfaceWithTwoMembers>(d)); Assert.Throws<InvalidCastException>(() => ((BaseInterfaceWithTwoMembers)d).Foo()); }
public void InterfaceWithTwoMembers_InSubClass() { dynamic d = new EmptyClass(); Assert.Throws <RuntimeBinderException>(() => d.Foo()); Assert.Throws <InvalidCastException>(() => Helpers.Cast <BaseInterfaceWithTwoMembers>(d)); Assert.Throws <InvalidCastException>(() => ((BaseInterfaceWithTwoMembers)d).Foo()); }