- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个带有 xUnit 的 .NET Core 项目。不过,我无法再使用 Resharper 运行任何测试。即使是非常简单的测试也是不确定的。例如。:
using Xunit;
public class MyTests
{
[Fact]
public void MySuperTest()
{
Assert.Equal(1, 1);
}
}
2017.08.04 16:58:41.304 INFO BuildStage started
2017.08.04 16:58:41.304 INFO Build policy: Automatic
2017.08.04 16:58:42.636 INFO 1 projects built
2017.08.04 16:58:42.636 VERBOSE Computershare.AssetManagement.Testing
2017.08.04 16:58:42.637 INFO BuildStage completed
2017.08.04 16:58:42.638 INFO RefreshProjectPropertiesStage started
2017.08.04 16:58:42.638 INFO RefreshProjectPropertiesStage completed
2017.08.04 16:58:42.640 INFO DiscoveryStage started
2017.08.04 16:58:42.641 INFO Test exploration required for 1 projects
2017.08.04 16:58:42.641 VERBOSE Computershare.AssetManagement.Testing
2017.08.04 16:58:42.643 INFO DiscoveryStage completed
2017.08.04 16:58:42.643 INFO BuildPipelineStage started
2017.08.04 16:58:42.643 INFO BuildPipelineStage completed
2017.08.04 16:58:42.643 INFO ApplyRulesStage started
2017.08.04 16:58:42.647 INFO Got 1 elements (1 explicit) to run
2017.08.04 16:58:42.647 INFO Marking 1 elements as Pending
2017.08.04 16:58:42.679 INFO Marking elements as Pending completed
2017.08.04 16:58:42.679 INFO Distributing 1 elements into runs
2017.08.04 16:58:42.695 INFO Host Controller initialization started
2017.08.04 16:58:42.695 VERBOSE Host Controller: DebugTaskRunnerHostController
2017.08.04 16:58:42.695 INFO Host Controller initialization completed
2017.08.04 16:58:42.721 INFO Distributing elements completed
2017.08.04 16:58:42.721 INFO Created 1 unit-test runs
2017.08.04 16:58:42.721 INFO ApplyRulesStage completed
2017.08.04 16:58:42.721 INFO RunTestsStage started
2017.08.04 16:58:42.722 VERBOSE Running up to 1 unit-test runs in parallel
2017.08.04 16:58:42.727 INFO Run: 28147df6-3156-4f24-bd5a-ca737ab6c43a - Started
2017.08.04 16:58:42.728 VERBOSE Provider: xUnit.net
Project: Computershare.AssetManagement.Testing
Target Framework: .NETCoreApp,Version=v1.1
Strategy: JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestRunStrategy
Runtime Enviroment:
Platform Type: x64
Platform Version: v4_0
2017.08.04 16:58:42.747 TRACE Register handler for message type 'TestSession.Message', protocol version '1'
2017.08.04 16:58:42.747 TRACE Register handler for message type 'ProtocolVersion', protocol version '<unset>'
2017.08.04 16:58:42.747 TRACE Register handler for message type 'TestSession.Connected', protocol version '<unset>'
2017.08.04 16:58:42.747 TRACE Register handler for message type 'TestExecution.CustomTestHostLaunch', protocol version '1'
2017.08.04 16:58:42.748 TRACE Register handler for message type 'TestExecution.Completed', protocol version '1'
2017.08.04 16:58:42.748 TRACE Register handler for message type 'TestExecution.StatsChange', protocol version '1'
2017.08.04 16:58:42.750 INFO Starting process: dotnet vstest /port:47441
2017.08.04 16:58:42.754 INFO Started process with pid 12856
2017.08.04 16:58:43.266 TRACE Processing message 'TestSession.Connected'
2017.08.04 16:58:43.266 TRACE Processed message 'TestSession.Connected'
2017.08.04 16:58:43.272 TRACE Processing message 'ProtocolVersion'
2017.08.04 16:58:43.274 INFO Using test adapter: ...PROJECT PATH REMOVED...\bin\Debug\netcoreapp1.1\xunit.runner.visualstudio.dotnetcore.testadapter.dll
2017.08.04 16:58:43.274 WARN File ...PROJECT PATH REMOVED...\bin\Debug\netcoreapp1.1\xunit.runner.visualstudio.dotnetcore.testadapter.dll does not exist on disk
2017.08.04 16:58:43.304 ERROR Transition failed: Transition from state <HandShake> on event <remote::.ProtocolVersion>. Cause: System.InvalidOperationException: Test-cases are missing for the selected tests. Did discovery succeed? 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. Did discovery succeed?
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__e(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.PassiveStateMachine`2.ProcessQueuedEvents()
at Appccelerate.StateMachine.PassiveStateMachine`2.Execute()
at Appccelerate.StateMachine.PassiveStateMachine`2.Fire(TEvent eventId, Object eventArgument)
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.Channel.DotNetCoreMessageListener.<>c__DisplayClass2`1.<RegisterMessage>b__1(JToken payload)
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.Channel.DotNetCoreMessageListener.OnMessage(String rawMessage)
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.Channel.DotNetCoreRemoteChannel.ReaderThreadProc()
at JetBrains.ReSharper.TaskRunnerFramework.RemoteChannelBase.<Start>b__0(Object _)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_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.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
”
2017.08.04 16:58:43.306 ERROR Run: 28147df6-3156-4f24-bd5a-ca737ab6c43a - Faulted
2017.08.04 16:58:43.306 ERROR System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Test-cases are missing for the selected tests. Did discovery succeed?
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)
--- End of inner exception stack trace ---
at JetBrains.ReSharper.UnitTestFramework.Launch.Stages.RunTestsStage.<>c__DisplayClassc.<StartSingleRun>b__8()
---> (Inner Exception #0) System.InvalidOperationException: Test-cases are missing for the selected tests. Did discovery succeed?
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)<---
2017.08.04 16:58:43.306 TRACE Processed message 'ProtocolVersion'
2017.08.04 16:58:43.306 INFO RunTestsStage completed
2017.08.04 16:58:43.307 INFO Finishing run
2017.08.04 16:58:43.316 INFO Run is finished
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="1.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageReference Include="System.Runtime.InteropServices.WindowsRuntime" Version="4.3.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.console" Version="2.2.0" />
</ItemGroup>
最佳答案
错误在于我选择了要导入的 Nuget 包。
代替:
<PackageReference Include="xunit.runner.console" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
关于.net - Resharper 未运行 xUnit 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45511439/
我找不到任何关于我认为是一个相当明显的问题的信息。xunit.console.clr4 命令行 arg 帮助状态: usage: xunit.console.clr4 [options] usage
当我们使用 MSTest 时,我们有几个环境有自己的运行设置。由于 Microsoft 正在放弃 MSTest,我们将转向 xUnit。无论是通过运行设置还是命令行属性,我都需要一种在 xUnit 测
我试图使用 OpenCover(今天下载)来覆盖我的测试。这是我使用的命令行: OpenCover.Console.exe -target:"c:\Programmes2\xunit\xunit.co
我正在学习使用单元测试,我创建了一个项目,添加了 xunit 引用。 以及以下代码: namespace UnitTestProject { public partial class Form
Closed. This question does not meet Stack Overflow guidelines。它当前不接受答案。 想要改善这个问题吗?更新问题,以便将其作为on-topi
我有一个在 Windows 上构建的程序集 我想在 Linux 中的单声道上运行 xUnit 测试。 但是,我发现虽然其中 400 个测试可以(按顺序)运行,但某些测试要么挂起 xUnit 运行程序,
我有一个 F# 类库,其中包含使用 NuGet 安装的“xUnit.net”和“xUnit.net Runners”包。我有以下代码: module XUnitTest open Xunit [] l
I know that this question has been asked multiple times before I raise it again, However I still cou
我们使用的是 dotCover 2.7 和 xUnit.net 1.9.2。 在我的机器 (Windows 7) 和同事的机器 (Windows 8) 上,我们可以从命令行针对我们使用 xUnit.n
是否可以将 xUnit 与 LINQPad 一起使用? 能够首先为在 LINQPad 中设计的概念编写一些测试会很棒。这比添加另一个 ConsoleApp23423894238 更容易,只是为了能够快
我有一组需要共享状态的 xunit.net 测试。希望我希望这些测试能够并行运行。所以我希望运行者这样做: 创建共享夹具 运行并行所有使用该夹具的测试 在阅读 xunit 文档时,它说要在测试类之间共
我需要跳过基于类中某些 bool 条件的测试方法。是否可以?如何实现?我试过扩展 FactAttribute 但我无法获得 Test 类的实例。 我的代码如下: using System; using
我有兴趣在多个类上重用测试理论,特别是一些需要相同测试的构造函数。我最初有使用委托(delegate)来执行此功能的想法。 但是,我认为我可能正在尝试重新发明轮子,尽管 C# 具有一些功能,但我认为我
我正在为我的 DataAccessRepository(使用 Entity Framework )类编写测试用例。此类在构造函数中采用两个参数。 1)连接对象 2) Automapper 对象 现在,
xUnit 相当于 NUnit 的 [TestFixtureSetUp] ? 我们探索发现IUseFixture相当于[TestFixtureSetUp] ,但它没有按预期工作。 正如我们所探索的(在
Xunit 1.9.x 为用户提供了 DynamicSkipExample.cs 帮助他设置动态跳过 [Fact] 的示例。 事实证明,这在执行一些跨平台开发时非常有用。当由于底层上下文(操作系统、文
我正在尝试使用 xUnit.net 作为 SpecFlow 的测试运行器。来自官方下载区的 SpecFlow 1.2 二进制文件不包含 xUnit.net 提供程序,但 GitHub 上的主分支有一个
当我尝试运行我的 xUnit.net 测试时,出现此错误: [xUnit.net 00:00:00.63] xunit.UnitTest1.TestTheAnswer [FAIL] Fai
我已经转移到 xunit.net 2.0 测试版,但需要 AutoFixture 的一些功能,这仍然取决于当前的 1.9.2 稳定版本 (CompositeDataAttribute)。据我所知 Au
我已经使用 NUnit 多年了,我想尝试 XUnit。所以我安装了 XUnit 并运行了允许您通过 TD.net 运行 XUnit 的可执行文件。 我似乎不能一次运行多个测试。使用 NUnit + T
我是一名优秀的程序员,十分优秀!