none
Unit tests dont run

    Question

  • If I right click in a unit test and click debug tests I get a message that says "Build succeeded".  And that's it.

    I used to get a message in the console that says something to the effect of "0 tests discovered" but now I don't even get that.

    Visual studio version is: 15.0.0-RC.4+26206.0

    I've seen: https://github.com/nunit/dotnet-test-nunit/issues/99

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFrameworks>netcoreapp1.1</TargetFrameworks>
      </PropertyGroup>
      <ItemGroup>
        <PackageReference Include="dotnet-test-nunit" Version="3.4.0-beta-3" />
        <PackageReference Include="LeaderAnalytics.AdaptiveClient" Version="1.7.0" />
        <PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
        <PackageReference Include="NETStandard.Library" Version="1.6.1" />
        <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
        <PackageReference Include="NUnit" Version="3.6.0" />
        <PackageReference Include="Moq" Version="4.6.38-alpha" />
        <PackageReference Include="Autofac" Version="4.2.1" />
        <PackageReference Include="NUnit3TestAdapter" Version="3.7.0" />
      </ItemGroup>
    </Project>

    Thursday, February 9, 2017 2:32 AM

All replies

  • Hello,

    Not positive this will solve your issue but worth trying. Copy the unit test, cut it to the clipboard. Build the solution. Drop the unit test back in, build the solution from Solution Explorer. Now try running the test again.

    You should be able to run the test via CodeLens e.g. but that may be dependent on the edition of Visual Studio you have.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, February 9, 2017 1:51 PM
  • Thanks but it doesn't work.  I also tried my ancient healing dance but it doesn't work either.
    Thursday, February 9, 2017 2:31 PM
  • Hi friend, 

    As a workaround you could use  Xunit instead if it's possible for you, at least it works well in my side(VS2015 update3). 

    I've already tested it with VS 2017 RC in my side, and I got the same issue as yours. 

    Best regards, 

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Monday, February 13, 2017 1:43 PM
  • Hi friend, 

    I've reported it this issue to develop community, and the engineers from Microsoft will evaluate it seriously.

    https://developercommunity.visualstudio.com/content/problem/20320/cannot-test-net-core-using-nunit.html 

    Thanks for your understanding.


    Best regards,

    Fletch 



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, February 17, 2017 11:17 AM