-
Notifications
You must be signed in to change notification settings - Fork 25
Does not work after migrating to csproj #108
Comments
The new CSPROJ format officially deprecates support for the |
@rprouse Can you please give an example of how I can run my Nunit tests using NUnitLite on netcoreapp1.1? |
@sepidehkh I hope to write an updated blog post about how to do it soon, but in the meantime, my original .NET Core blog post should get you started. http://www.alteridem.net/2015/11/04/testing-net-core-using-nunit-3/ To make the migration easy, you can leave your tests as-is and add a .NET Core console app to be the runner. Reference your tests and use one of your tests classes as the constructor to Let me know how it goes... |
Thank you @rprouse! That fixed my problem. |
how about xunit? |
@mayuanyang xunit works, but that isn't useful for people who prefer NUnit or have many unit tests to convert. We know that NUnitLite is not a viable solution in the long-run, but it will hopefully hold people over in the short term while we update the adapter. |
What do you exactly mean by "use one of your tests classes as constructor to Basically I use AutoRun like this, but still no tests are discovered or run: All tests are in same assembly/project as the console-app starting Update: Got this in my Output-window:
|
@rprouse I am trying to use your suggested NUnitLite setup but I need to be able to output the results preferably in the nunit2 format, is this possible? The command that I have been using in the nunit3-console.exe is "{ProjectDll} --result nunit-tests.xml;format=nunit2". Any help would be greatly appreciated. |
I tried just sending those exact same args into my command line and it seemed to work so you can ignore my previous question. I would like to know if there is any ETA on getting the VS2017 integration working. Thank you. |
Hi, Is there an ETA for this? I have set up, as suggested before, a console application using NUnitLite to run my tests, but I've found out that, every time the NUnit package is restored, an empty Program class with its own Main(string[] args) method is being generated. I have not found a way to explicitly tell Visual Studio that it should use my Main method as the entry point (Visual Studio won't discover any entry point to let me choose it on the project properties!), and because the autogenerated Program class is always empty, using NUnitLite to run my NUnit tests is being a pain. Is there at least any way to turn the autogeneration of this class off? Nonetheless, thank you very much for your awesome framework, keep up the good work! |
@SergioLuis I didn't find a way to turn off the autogeneration (my theory is this is an issue caused by the conversion to csproj) but all I did to solve this was create a new console application project and copy my tests in. |
Hi rprouse, Do you have an idea as to when will this be fixed ? Thanks |
I just think that porting form NUnit to XUnit would be a right thing to do as this project is not very well maintained and moving very slowly comparing to the other project.. |
@CurlyFire there is a working PR at nunit/nunit3-vs-adapter#313 and we are getting very close to being ready to do an initial release. I would suggest following that PR and it's issue nunit/nunit3-vs-adapter#297 as that is where the work is happening. The API for the adapter was changed with the latest release of .NET Core, so this project is no longer needed. If you want, you could help us test and move your project forward by using our CI feeds. I can provide info on how to do so if you are interested. Better yet, watch nunit/nunit3-vs-adapter#297 as I will likely post a quick walk-through there soon. @toralux this project is not maintained because the test API that this project uses was dropped in favor of the old Visual Studio test API. We knew that was the plan, so stopped work on this project, but couldn't get the documentation we needed to update the other project until just before Visual Studio 2017 was released. That is why we are a bit slow to release, but I have been working nearly exclusively on enabling .NET Core support since Visual Studio 2017 was released. The xUnit project had a head start because the .NET Core team is using it and had a vested interest in making it work. |
@rprouse Great, I'll talk to my project manager if that would be a possibility that we could help you out. I was wondering, since the PR is for .Net Core support in visual studio, will I be able to run NUnit tests from the command line without using NUnitLite ? |
@CurlyFire once the adapter for .Net Core is done, you should be able to run your tests with the |
@CurlyFire as @la-yumba says, you will be able to use the |
…roj. dotnet test doesn't support NUnit yet but should with the next release. For more info: nunit/dotnet-test-nunit#108
@rprouse My dotnet core nunit-tests runs like a charm now using the "NUnit3TestAdapter" version "3.8.0-alpha1", both from command-line (dotnet test) and Visual Studio 2017's Test Explorer. |
Great news @toralux, thanks for letting me know. For everyone else tracking this issue, the first release is out, you can find more info on my blog at http://www.alteridem.net/2017/05/04/test-net-core-nunit-vs2017/ I am going to leave this issue open so that people who are migrating can easily find it. |
Our thanks to @rprouse too! All of our 700+ unit tests written in NUnit against .Net Core assemblies are passing again. Great work indeed!!! |
Thanks @rprouse. Is there a parameter to generate Xml files ? |
@EChaffraix as far as I know we cannot generate NUnit XML results yet, so I added nunit/nunit3-vs-adapter#323 to track that. If you are using |
@rprouse Exactly ! Thank you. Under linux le command is |
This message is displayed:
No test discoverer is registered to perform discovery of test cases. Register a test discoverer and try again.
This is my csproj file:
The text was updated successfully, but these errors were encountered: