简体   繁体   English

使用 NCrunch 时,如何批准从 Verify.NUnit 报告的差异?

[英]When using NCrunch, How Would Differences Reported From Verify.NUnit Be Approved?

Verify.NUnit version: 1.19.2验证.NUnit版本:1.19.2

NCrunch version: 4.3.0.13 trial NCrunch 版本:4.3.0.13 试用

Visual Studio 2019: 16.4.5 Visual Studio 2019:16.4.5

In this commit from the SimonCropp/Verify repo, both the command line and diff viewer functionality of the Verify library is disabled when NCrunch is detected.SimonCropp/Verify库的此提交中,当检测到 NCrunch 时, Verify库的命令行和差异查看器功能都被禁用。 I understand that during the test executions that occur automatically as code is edited, we would not want the diff viewer to pop up.我知道在编辑代码时自动发生的测试执行期间,我们不希望差异查看器弹出。 But I expected that when I manually ran the tests from NCrunch the diff viewer and clipboard functionality of would work.但是我希望当我从 NCrunch 手动运行测试时,差异查看器和剪贴板功能会起作用。 I am just trialing NCrunch right now to see if it would work for my team, so don't necessarily need a feature update for Verify.NUnit.我现在只是在试用 NCrunch,看看它是否适合我的团队,所以不一定需要为 Verify.NUnit 进行功能更新。

What would be the recommended workflow when a test failure from a Verify.NUnit assertion fails when using NCrunch?当使用 NCrunch 时,Verify.NUnit 断言的测试失败失败时,推荐的工作流程是什么?

Sample test:样品测试:

using System.Threading.Tasks;
using NUnit.Framework;

namespace TestProject
{
    [TestFixture]
    public class MyTestClass
    {
        [Test]
        public async Task MyTest()
        {
            const string actual = @"This is a
a string
of text.";
            await VerifyNUnit.Verifier.Verify(actual);
        }
    }
}

this has been fixed in version 8.2.1 of Verify and version 4.5.0.3 of ncrunch.这已在验证的 8.2.1 版和 ncrunch 的 4.5.0.3 版中得到修复。 Sorry it took so long, but I was waiting for the new feature in ncrunch to enable this抱歉花了这么长时间,但我正在等待 ncrunch 中的新功能来启用此功能

I'm not sure if this is optimal, but what I've found so far is this process:我不确定这是否是最佳的,但到目前为止我发现的是这个过程:

  1. Double-click test failure in NCrunch test list to go to the test双击NCrunch测试列表中的测试失败进入测试
  2. Press the VS TestExplorer.RunAllTestsInContext hotkey (default Ctrl+R, T) to run the test under the cursor.按 VS TestExplorer.RunAllTestsInContext热键(默认 Ctrl+R、T)在光标下运行测试。
  3. The run from Test Explorer will allow the clipboard and diff viewer functionality of Verify.NUnit to execute allowing approval of the test results.从测试资源管理器运行将允许执行Verify.NUnit的剪贴板和差异查看器功能,允许批准测试结果。

This requires both Test Explorer and NCrunch to be properly configured to run tests in VS, which may not be the case for all developers.这需要正确配置测试资源管理器和 NCrunch 以在 VS 中运行测试,这可能不是所有开发人员的情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM