juunas
juunas

Reputation: 58908

Running UWP unit tests in VS 2017

For some reason Visual Studio 2017 does not recognize unit tests in Universal Windows Unit Test App projects.

Steps to reproduce:

  1. Create a new Unit Test App (Universal Windows) in VS 2017
  2. Add Assert.IsTrue(true); to the unit test created
  3. Click on Test -> Run -> All Tests

Expected: unit test discovered and run successfully.

Actual: no tests found.

Output Tests produces absolutely no output.

Comment if there is a log file containing some more info and I'll add it.

EDIT: So it turns out they don't work in 2015 either. I have ReSharper in 2015 which is able to run them. But why can't the VS runner run them?

Upvotes: 2

Views: 648

Answers (2)

juunas
juunas

Reputation: 58908

This now works in Visual Studio 2017 (version 15.4.5 currently).

After building the solution, the tests appear right away. Deploying the test project may have also worked in the older versions.

Upvotes: 1

Fernando Santiago
Fernando Santiago

Reputation: 21

By sheer dumb luck (or just desperation), I went to my Test project and Deployed it (right click on project-> Deploy). That made the tests appear and now they run.

Upvotes: 2

Related Questions