Extra Classes in Code Coverage Results Window(代码覆盖结果窗口中的额外类)
问题描述
在 Visual Studio 2010 中运行我的自动化测试后,代码覆盖率结果"选项卡显示了一些我不理解的内容.被测试的类之一称为 ApplicationData.它显示在代码覆盖率列表中.但它的变体也出现了,在这种情况下出现了 3 次(见下文).
After running my automated tests in Visual Studio 2010, the Code Coverage Results tab shows something I don't understand. One of the classes that gets tested is called ApplicationData. It shows up in the code coverage list. But variants of it also show up, three times (see below) in this case.
如果我在代码覆盖选项卡中展开每个 ApplicationData 实例,第一个显示所有方法,其余显示一些方法.
If I expand each ApplicationData instance in the code coverage tab, the first shows all methods, and the rest show some methods.
我的问题是……那些附加了 <>c__DisplayClass 的额外 ApplicationData 类是什么?
My question is... What are those extra ApplicationData classes with <>c__DisplayClass appended?
推荐答案
这些是自动生成的类,用于闭包等语法糖功能.即
These are auto-generated classes for syntactic sugar features like closures. I.e.
int v = 1;
myIntArray.Foreach( item => { v+= item; });
将生成一些类来适当地存储/传递 v
.
Will produce some class for storing/passing v
appropriately.
这篇关于代码覆盖结果窗口中的额外类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:代码覆盖结果窗口中的额外类


- CanBeNull和ReSharper-将其用于异步任务? 2022-01-01
- 使用 rss + c# 2022-01-01
- 为什么 C# 中的堆栈大小正好是 1 MB? 2022-01-01
- 带问号的 nvarchar 列结果 2022-01-01
- Azure Active Directory 与 MVC,客户端和资源标识同一 2022-01-01
- Windows 喜欢在 LINUX 中使用 MONO 进行服务开发? 2022-01-01
- C# 通过连接字符串检索正确的 DbConnection 对象 2022-01-01
- 是否可以在 .Net 3.5 中进行通用控件? 2022-01-01
- 在 C# 中异步处理项目队列 2022-01-01
- 在 LINQ to SQL 中使用 contains() 2022-01-01