.net-core - ReSharper 2018.1.2 NUnit TestCaseSource (.NET Core/VS2017)

标签 .net-core nunit resharper

我已经看到以下所有问题:

  • NUnit .NET Core running through Resharper
  • Running NUnit Tests in .NET Core with ReSharper
  • NUnit TestCaseSource

  • 尽管遵循了他们的所有建议并在我所有的
    测试项目:
    <PackageReference Include="NUnit" Version="3.10.1" />
    <PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
    

    我仍然在 ReSharper(版本 2018.1.2)的单元测试资源管理器窗口中收到以下错误:
    2018.06.23 11:22:21.292   ERROR Transition failed: Transition from state <HandShake> on event <remote::.ProtocolVersion>. Cause: System.InvalidOperationException: Test-cases are missing for the selected tests. Rebuild the project and try again. at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.SendGetProcessStartInfo() at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument) at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
    
    --- EXCEPTION #1/1 [LoggerException]
    Message = “
      Transition failed: Transition from state <HandShake> on event <remote::.ProtocolVersion>.
      Cause: System.InvalidOperationException: Test-cases are missing for the selected tests. Rebuild the project and try again.
         at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.SendGetProcessStartInfo()
         at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument)
         at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
    ”
    ExceptionPath = Root
    ClassName = JetBrains.Util.LoggerException
    HResult = COR_E_APPLICATION=80131600
    StackTraceString = “
      at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestProtocol.<.ctor>b__22_14(Object sender, TransitionExceptionEventArgs`2 args)
         at Appccelerate.StateMachine.Machine.StateMachine`2.RaiseEvent[T](EventHandler`1 eventHandler, T arguments, ITransitionContext`2 context, Boolean raiseEventOnException)
         at Appccelerate.StateMachine.Machine.StateMachine`2.OnExceptionThrown(ITransitionContext`2 context, Exception exception)
         at Appccelerate.StateMachine.Machine.Contexts.TransitionContext`2.OnExceptionThrown(Exception exception)
         at Appccelerate.StateMachine.Machine.States.State`2.HandleException(Exception exception, ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.States.State`2.HandleEntryActionException(ITransitionContext`2 context, Exception exception)
         at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryActions(ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.States.State`2.Entry(ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.States.State`2.EnterShallow(ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.States.State`2.EnterHistoryNone(ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.States.State`2.EnterByHistory(ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.States.State`2.Fire(ITransitionContext`2 context)
         at Appccelerate.StateMachine.Machine.StateMachine`2.Fire(TEvent eventId, Object eventArgument)
         at Appccelerate.StateMachine.ActiveStateMachine`2.ProcessEventQueue(CancellationToken cancellationToken)
         at Appccelerate.StateMachine.ActiveStateMachine`2.<Start>b__32_0()
         at System.Threading.Tasks.Task.InnerInvoke()
         at System.Threading.Tasks.Task.Execute()
         at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
         at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
         at System.Threading.Tasks.ThreadPoolTaskScheduler.LongRunningThreadWork(Object obj)
         at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
         at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
         at System.Threading.ThreadHelper.ThreadStart(Object obj)
    ”
    
    2018.06.23 11:22:21.315   ERROR System.InvalidOperationException: Test-cases are missing for the selected tests. Rebuild the project and try again.
       at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.SendGetProcessStartInfo()
       at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument)
       at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
    2018.06.23 11:22:21.316    WARN Element UnitTests.Tests.RegressionTests was left pending after its run completion.
    2018.06.23 11:22:21.316    WARN Element UnitTests.Tests.RegressionTests.TestAllRegressions was left pending after its run completion.
    

    这些是每个包的最新版本,但我也尝试将 NUnit 的版本与 TestAdapter 的版本 (3.10.0) 相匹配。其中最令人困惑的部分是 Visual Studio 的测试资源管理器运行测试没有问题!我非常想使用 ReSharper 的资源管理器在我的测试中轻松运行他们的分析和覆盖工具。

    此外,在某个时间点 ReSharper 的测试资源管理器曾经可以工作,但我不知道导致它的特定版本组合。此设置仍然适用于基本 [Test]样式测试,仅对 [TestCaseSource] 失败测试。

    预计到达时间: ReSharper 也没有运行命名空间级别的设置和拆卸装置。也许这是问题的一部分?

    我该如何解决?

    最佳答案

    这是一个错误。 JetBrains 在 ReSharper 2018.2 EAP 5 中修复了它。它仍然很挑剔,但是当它起作用时,它就起作用了。

    关于.net-core - ReSharper 2018.1.2 NUnit TestCaseSource (.NET Core/VS2017),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51004012/

    相关文章:

    f# - 如何在 Visual Studio 2017 RC 中创建 F# .Net Core ConsoleApp

    c# - 在 Linux 应用服务上的 docker 容器中运行 .Net Core 控制台应用程序

    .net-core - 在 "dotnet test --filter"选项中传递多个测试名称

    linux - Linux 中的 F# 单元测试项目与单声道(FAKE,NUnit 3)

    c# - 如何在 NUnit 3 中使用 ITestEventListener?

    c# - ReSharper 告诉我 Boolean.TryParse() 里面的 IF 语句是多余的?

    c# - 为什么控制台应用程序和 WebAPI 上加载的数据库值不同?

    c# - Nunit 测试命名约定示例

    windows-7 - 焦点跟随鼠标与 Resharper 导航冲突

    c# - ReSharper 向 .NET 2.0 项目发出 C# 3.0 代码检查警告