Skip to main content
no need to say you're new to X: https://meta.stackoverflow.com/q/296391/11107541
Source Link
starball
  • 61.2k
  • 56
  • 340
  • 1.1k

I'm new to unit testing and I'm trying to figure out if I should start using more of internal access modifier. 

I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. 

This makes me think that I should just always use internal because at least each project (should?) have its own testing project. Can you guys tell me why I

Why shouldn't one do this? When should Ione use private?

I'm new to unit testing and I'm trying to figure out if I should start using more of internal access modifier. I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. This makes me think that I should just always use internal because at least each project (should?) have its own testing project. Can you guys tell me why I shouldn't do this? When should I use private?

I'm trying to figure out if I should start using more of internal access modifier. 

I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. 

This makes me think that I should just always use internal because at least each project (should?) have its own testing project.

Why shouldn't one do this? When should one use private?

I'm new into unit testing and I'm trying to figure out if I should start using more of 'internal'internal access modifier. I know that if we use 'internal'internal and set the assembly variable 'InternalsVisibleTo'InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. This makes me think that I should just always use 'internal'internal because at least each project (should?) has it'shave its own testing project. Can you guys tell me a reason why I shouldn't do this? When should I use 'private'private?

I'm new in unit testing and I'm trying to figure out if I should start using more of 'internal' access modifier. I know that if we use 'internal' and set the assembly variable 'InternalsVisibleTo', we can test functions that we don't want to declare public from the testing project. This makes me think that I should just always use 'internal' because at least each project (should?) has it's own testing project. Can you guys tell me a reason why I shouldn't do this? When should I use 'private'?

I'm new to unit testing and I'm trying to figure out if I should start using more of internal access modifier. I know that if we use internal and set the assembly variable InternalsVisibleTo, we can test functions that we don't want to declare public from the testing project. This makes me think that I should just always use internal because at least each project (should?) have its own testing project. Can you guys tell me why I shouldn't do this? When should I use private?

added TDD tag (some answer argument based on TDD)
Link
EricSchaefer
  • 26.6k
  • 22
  • 74
  • 107
edited title
Link
Hertanto Lie
  • 9.5k
  • 7
  • 30
  • 27
Loading
grammar fix and add tag
Link
Hertanto Lie
  • 9.5k
  • 7
  • 30
  • 27
Loading
Source Link
Hertanto Lie
  • 9.5k
  • 7
  • 30
  • 27
Loading