Esempio n. 1
0
        public void TestGenerateOperatorData()
        {
            MethodInfo op = typeof(TestClass).GetMethod("op_Subtraction");
            IReadOnlyList <MemberRef> expectedAttr = new MemberRef[]
            { new MemberRef("STAThreadAttribute", MemberRefType.Class, typeof(STAThreadAttribute).MetadataToken) };

            methodGen.GenerateName(op).Returns("CSDocNet.TestDoc.TestClass.op_Subtraction");
            methodGen.GenerateAttributes(op).Returns(expectedAttr);

            MemberData member = gen.GenerateMemberData(op);
            MethodData method = methodGen.GenerateMethodData(op);

            OperatorData opData = gen.GenerateOperatorData(op);

            Assert.AreEqual(member, opData.Member);
            Assert.AreEqual(method, opData.Method);
            Assert.AreEqual(Operator.Subtraction, opData.Operator);
        }
Esempio n. 2
0
        public string GenerateName(MethodInfo member)
        {
            Check.Ref(member);

            return(methodGen.GenerateName(member));
        }