c# - Nunit 3 中的随机发生器

标签 c# nunit-3.0

我正在将我的项目从 NUnit 2.6.3 迁移到 3.2.1。我发现“Randomizer”类从“NUnit.Framework”移动到“NUnit.Framework.Internal”,但我找不到方法 Randomizer.GetDoubles 或任何等效方法。

有什么想法吗?

最佳答案

Randomizer 类已被移动,现在可以通过 TestContext.CurrentContext.Random 访问。

不再有 Randomizer.GetDoubles,但有 Randomizer.NextDouble(double min, double max) 方法。

[ Docs ]

关于c# - Nunit 3 中的随机发生器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37864275/

相关文章:

c# - AllureConfig 输出目录路径 NUnit3

C#:为什么范围的上限是互斥的?

c# - 使用 .Net 测试 JavaScript 类 - 最佳实践?

c# - 如何使用 moq 对在 .NET 中使用 asmx 服务的应用程序进行单元测试

unit-testing - 为什么 nUnit 测试经常在 Visual Studio 2015 中消失?

c# - 如何在 Windows 上安装 NUnit 3 控制台并运行测试?

c# - 使用 Entity Framework 编辑 datagridview 中的列标题标题

c# - 如何将多行字符串转换为数组,其中每个元素都是所述字符串的一行?

visual-studio - VS 中的 log4net 和 NUnit 3.2 以及控制台输出

nunit-3.0 - NUNIT3-CONSOLE 排除特定测试类别