void Run(I2 i) { // Viable callables: C18.M1() i.M1(); // Viable callables: I2.M2() i.M2(); }
public void TestG8() { var c = new G8(); I2 <BaseClass> i = c; I2 <DerivedClass> id = c; Assert.AreEqual(1, i[0]); Assert.AreEqual(1, id[0]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$getItem"]); Assert.NotNull(c["getItem"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$" + baseClassAlias + "$getItem"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$setItem"]); Assert.NotNull(c["setItem"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$" + baseClassAlias + "$setItem"]); Assert.AreEqual(2, i.Prop1); Assert.AreEqual(2, id.Prop1); Assert.AreEqual(i.Prop1, c["Prop1"]); Assert.AreEqual(i.Prop1, c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$Prop1"]); Assert.AreEqual(i.Prop1, c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$" + baseClassAlias + "$Prop1"]); Assert.Throws <NotImplementedException>(() => { i.e1 += () => { }; }); Assert.Throws <NotImplementedException>(() => { id.e1 += () => { }; }); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$adde1"]); Assert.NotNull(c["adde1"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$" + baseClassAlias + "$adde1"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$removee1"]); Assert.NotNull(c["removee1"]); Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$" + baseClassAlias + "$removee1"]); Assert.AreEqual(3, i.M1()); Assert.AreEqual(3, id.M1()); Assert.AreEqual(i.M1(), c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$M1"].As <Func <int> >()()); Assert.AreEqual(i.M1(), c["M1"].As <Func <int> >()()); Assert.AreEqual(i.M1(), c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I2$1$" + baseClassAlias + "$M1"].As <Func <int> >()()); }