ClassInitialize或ClassCleanup方法上没有跟踪或调试输出 [英] No Trace or Debug output on ClassInitialize or ClassCleanup methods

查看:118
本文介绍了ClassInitialize或ClassCleanup方法上没有跟踪或调试输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的单元测试类具有ClassInitialize和ClassCleanup的两个静态方法,并分别标记了它们各自的属性.对于它们的等效测试,我也有相同的要求(在运行测试之前和在运行测试之后).

My unit test class has the two static methods for ClassInitialize and ClassCleanup marked with their respective attributes. I also have the same for their test equivalent (before a test is run and after a test is run).

我对所有这些都使用Debug或Trace输出信息.我注意到,当我在测试方法的初始化和清除触发器上使用它时,信息将输出并在VS中可见.输出窗口.但是,当我在 单元测试类的ClassCleanup和ClassInitialize方法,那么Trace或Debug输出就消失在位存储桶中,并且从未被看到.

On all of them I am outputting information with either Debug or Trace. I noticed that when I use that on the test method's initialize and cleanup triggers the information is outputed and is visible in the VS. Output window. However, when I do the same in the unit test class's ClassCleanup and ClassInitialize methods, then the Trace or Debug output simply vanishes into the bit bucket and is never seen.

我在这里缺少什么?

推荐答案

您可以在此处共享屏幕截图或代码吗?

Can you sharing a screenshot or your codes here?

最好的问候


这篇关于ClassInitialize或ClassCleanup方法上没有跟踪或调试输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆