Exemple #1
0
                public string ToString(SignatureStyle style)
                {
                    string methodName = method.ToString(style);

                    if (isConstructor)
                    {
                        if (isStatic)
                        {
                            methodName = ".cctor";
                        }
                        else
                        {
                            methodName = ".ctor";
                        }
                    }

                    string result = declaringType.ToString(style) + "." + methodName;

                    if (style == SignatureStyle.Formal)
                    {
                        result += "(";
                        if (parameters != null)
                        {
                            result += parameters.ToString(style);
                        }
                        result += ")";
                    }
                    return(result);
                }
Exemple #2
0
        public void ParaListTest()
        {
            ParaList paraList = new ParaList("Block ?x, Block ?y, Car ?z");

            Assert.AreEqual("?x", paraList.Vars[0]);
            Assert.AreEqual("?y", paraList.Vars[1]);
            Assert.AreEqual("?z", paraList.Vars[2]);

            Assert.AreEqual("Block", paraList.Types[0]);
            Assert.AreEqual("Block", paraList.Types[1]);
            Assert.AreEqual("Car", paraList.Types[2]);

            Assert.AreEqual("Block ?x, Block ?y, Car ?z", paraList.ToString());
        }