c# - 单元测试应用程序(Windows 通用)中尚不存在 ExpectedException 属性?

标签 c# unit-testing windows-runtime visual-studio-2015 win-universal-app

我目前正在使用 .NET Framework 4.6 进行单元测试应用程序(Windows 通用)项目。我想在我的测试方法上添加 ExpectedException 属性,但似乎我无法在其 Microsoft.VisualStudio.TestPlatform.UnitTestFramework 命名空间中找到该属性。有人能解答这个问题吗?

最佳答案

ExpectedExeception 属性已删除/从未添加到 Windows 运行时。使用 Assert.ThrowsException 代替。

关于c# - 单元测试应用程序(Windows 通用)中尚不存在 ExpectedException 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35173030/

相关文章:

c# - 如何将参数数组序列化为 .NET Standard 2.0 中可用的 ProcessStartInfo 字符串?

c# - 依赖注入(inject)如何应用于这种情况?

C#/ Visual Studio : production and test code placement

deployment - 什么/为什么 WinRT 随机创建新的干净布局

c# - 如何使用 C# 中的 Keys 枚举检测小写键?

c# - 用于 Android 内存泄漏的 Mono

c# - winRT拖放,交换两个项目而不是插入

x86 - 包含x86 ARM x64二进制文件的单个NuGet软件包

python - 如何在 pytest 中的 mark.parametrize 中使用固定装置

c# - 如何确保在 NUnit 单元测试期间不访问文件系统和数据库?