Reputation: 7105
I successfully moved my code to the new Class Library (Package)
project type, all code build and compile. From what I can gather it is not possible to add a project reference
anymore
I could however set the Produce outputs on build
setting that created a dll in the artifacts\bin folder that I could reference from my Unit Test project. The problem that I'm experiencing now is that I can't step into the code from the referenced dll when debugging my Unit Test, there is a .pdb file within the folder I'm referencing from but I just can't seem to step through my code.Is there anything I'm missing?
Upvotes: 1
Views: 877
Reputation: 851
Microsoft unit testing is a really different thing than unit testing a package application. I recommend you to use xUnit. xUnit is both cross platform and easy to use.
How to (The difficult way):
1) Create a package application(with your main project to be tested)
2) Check your dnx version from your global.json file in your project(ex: mine is 1.0.0-beta5)
3) Look at the link that i sent you, there is a green table that shows you which versions are supported with the dnx versions.
So in my case: my supported xunit package version is 2.1.0-beta3-build3029
and runner version is 2.1.0-beta3-build99
4) Open up your project.json file(test project) and add the packages(according to the documentation that i sent you.)
"dependencies": {
"xunit": "2.1.0-beta3-build3029",
"xunit.runner.dnx": "2.1.0-beta3-build99"
},
and
"commands": {
"test": "xunit.runner.dnx"
},
and thats all. It must be working now. You can find the documentation in xunit github page(its a little bit different than MStest).
How to (The easy way / This may not work due to the version confliction mentioned above. Visual studio will always get the latest version, while latest version might not be the one that suites your dnx version):
Upvotes: 3