コード例 #1
0
ファイル: N2638A.cs プロジェクト: zwmyint/Bridge
        public void TestG1()
        {
            var            c = new G1 <BaseClass>();
            I1 <BaseClass> i = c;

            Assert.AreEqual(1, i[0]);
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$getItem"]);
            Assert.Null(c["getItem"]);
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$getItem"]);
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$setItem"]);
            Assert.Null(c["setItem"]);
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$setItem"]);

            Assert.AreEqual(2, i.Prop1);
            Assert.AreEqual(i.Prop1, c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$Prop1"]);
            Assert.Null(c["Prop1"]);
            Assert.AreEqual(i.Prop1, c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$Prop1"]);

            Assert.Throws <NotImplementedException>(() => { i.e1 += () => { }; });
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$adde1"]);
            Assert.Null(c["adde1"]);
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$adde1"]);
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$removee1"]);
            Assert.Null(c["removee1"]);
            Assert.NotNull(c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$removee1"]);

            Assert.AreEqual(3, i.M1());
            Assert.Null(c["M1"]);
            Assert.AreEqual(i.M1(), c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$M1"].As <Func <int> >()());
            Assert.AreEqual(i.M1(), c["Bridge$ClientTest$Batch3$BridgeIssues$Bridge2638A$I1$1$" + baseClassAlias + "$M1"].As <Func <int> >()());
        }