K
K
Kirill H2017-06-21 19:20:04
C++ / C#
Kirill H, 2017-06-21 19:20:04

How to write Unit Tests for an SLR application?

In general, the problem is that you need to write several classes and test them. I know how and I can write UnitTest for static and dynamic libs. But I need a specific CLR application.
But the fact is that an error occurs when running tests (moreover, both the CLR and NativeUnitTest are in the same Solution, the link is indicated, the paths in Settings-> C / C ++ to the folder with .h .cpp CLR are also indicated) , the LINK2019 linker error, simply speaking, if the definition is placed in cpp, then the tests simply do not see it, an Internet search showed that this is due to the fact that all this beauty is not linked before launch and the test project as a result does not see anything beyond the headers, somehow so I understood(well, this is backed up by the experience of practical attempts to transfer the definition to the header and then everything is successful, but such an option, as you know, is not an option :) I want everything according to my mind) .
What do you recommend how to fix this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question