苯苯的博客

新随笔 联系 管理
  21 Posts :: 0 Stories :: 3 Comments :: 0 Trackbacks

 

 public static string GetCaseMethodName()
        
{
            
try
            
{
                StackTrace st 
= new StackTrace();
                StackFrame[] stackFrames 
= st.GetFrames();
                
foreach (StackFrame sf in stackFrames)
                
{
                    MethodBase mb 
= sf.GetMethod();
                    
if (mb.GetCustomAttributes(typeof(TestMethodAttribute), false).Length > 0)
                        
return mb.Name;
                }

                
return string.Empty;
            }

            
catch throw; }
        }
posted on 2008-08-11 03:50 one 阅读(8) 评论(0)  编辑 收藏 网摘 所属分类: 工作

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-11-06 11:26 编辑过
Google站内搜索

China-pub 计算机图书网上专卖店!6.5万品种 2-8折!
近千种 9-95 新二手计算图书火热销售中!
开发者征途系统新作:《设计模式——基于C#的工程化实现及扩展》



相关文章:

相关链接: