コード例 #1
0
        public void CreateBody()
        {
            FunctionBody = FunctionHeader;

            FunctionBody += @"
{
            " + Type.Name + " obj= new " + Type.Name + "();" + @"
            " + MethodInfo.ReturnType.ToString() + " retVal = obj." + MethodInfo.Name + "(";
            foreach (object item in Parameters)
            {
                FunctionBody += item.ToString() + ",";
            }
            FunctionBody  = FunctionBody.Substring(0, FunctionBody.Length - 1);//remove trailing comma
            FunctionBody += ");" + @"
            if (retVal==" + ExpectedValue.ToString() + @")
            {
                Assert(true);
            }else{
                Assert(false);
            }
        
                
}";
        }