问题
How to run xUnit 2.1.0-beta-* for DNX projects with ReSharper?
When the ReSharper do find the tests, it fails on running them with System.IO.FileNotFoundException that indicates the unit test assembly is not found.
Due to my understanding, DNX projects do NOT generate assemblies in \bin folder when they are compiled with VisualStudio 2015. Is there a way to force DNX projects generate assemblies like the tranditional class libraries projects?
Any ideas?
回答1:
DNX tests aren't currently supported by ReSharper or the xunit plugin. It's a whole new execution model, and hasn't yet been implemented for ReSharper. I'd expect to see support as DNX and asp.net stabilise and near release.
回答2:
xUnit now supports DNX. Not sure if this will let you run the tests from ReSharper though.
Here are the instructions, taken from https://github.com/xunit/dnx.xunit :
This runner supports xUnit.net tests for DNX 4.5.1+, and DNX Core 5+ (this includes ASP.NET 5+). Usage
To install this package, ensure your project.json contains the following lines:
{ "dependencies": { "xunit": "2.1.0-*", "xunit.runner.dnx": "2.1.0-*" }, "commands": { "test": "xunit.runner.dnx" } }
To run tests from the command line, use the following.
# Restore NuGet packages dnu restore # Run tests in current directory dnx test # Run tests if tests are not in the current directory dnx -p path/to/project test
来源:https://stackoverflow.com/questions/30827067/how-to-run-xunit-2-1-0-beta-for-dnx-projects-with-resharper