Note that there are some explanatory texts on larger screens.

plurals
  1. USuser1002059
    primarykey
    data
    text
    plurals
    1. COI see that most people on those two threads disagree with me. Perhaps I should just accept they are right. However, I would still like to know why. It would be especially irritating if the real answer was "because NUnit won't run the tests otherwise. I am afraid some of their arguments border on the surreal "you need to do that to save space" (so that would be a factor of about 2 in code size?), "you need to put tests in a separate file to ensure you only test the public interface" (it's so important InternalsVisibleTo was introduced to help), or even "that way you can reuse the tests" (???).
      singulars
    2. COThe tests are in the same file and in the same assembly as the code being tested. I am aware there is plenty of "advice" puyblished saying that this should not be done. But there is never any justification, and my opinion is that it's clearly wrong.
      singulars
    3. COI think my problem is a bit different. I can already compile the tests just fine. However, I cannot run them if I don't export them from the module. I suppose the attribute would help if I could get it to say that all internals are accessible to NUnit. But I have no idea where to start with that, and neither - it appears - does Google. I could obviously use the attribute after moving the tests to a different file, but that is a worse evil. I use them as executable documentation, so they really need to be close to the code. Many thanks for the reply.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload