h a l f b a k e r yEureka! Keeping naked people off the streets since 1999.
add, search, annotate, link, view, overview, recent, by name, best, random
news, help, about, links, report a problem
browse anonymously,
or get an account
and write.
register,
|
|
|
| |
Doable with reflection in C#. You can violate all public / private distinctions. |
|
| |
leave this set and you screw up your whole program in the most bizarre and dificult ways... |
|
| |
im not aware of a way to run unit tests which are external projects on private methods. The flag is ser only by that unit testing proj with its own attrib so no build problems should occur. |
|
| |
Ah. I can see what you are after now - the test-bed readily compiling and linking with the target methods without a lot of extra poking around e.g. Invoke( "TargetMethodName", param1, param2 ) etc. |
|
| |
Again, reflection could help to turn any assembly into a totally public assembly. This could be as a pre-build step to the test-bed. Still messy though. |
|
| |
I can't bun yet as I've never encountered this problem. If its complicated enough to be public it has a test that has decent code coverage. You could always build the test bed (if C#) into the module by using the 'internal' keyword rather than private. That would just leave you the problem of finding the test-bed entry point using reflection. Or other tricks using inheritence with protected methods. |
|
| |
I have to say though, that on the whole it needs to be a runtime setting as testing on any level assumes that what you are testing is fully equivalent to the shipped product i.e. binary compatible. |
|
| |
And after writing all that my nagging doubt has surfaced in the respect that you could well write a test-bed that proves everything works well but nobody can access anything. |
|
| |
All in all its probably better to use some other coding patterns like hidden constructors. |
|
| |