Use the #IF directive to define unit test

I have this specific call in my code, and I found that when working with a full application, when I test using unit test integration, I need to have different settings when setting up.

Is there a way to test a call from unit test using a directive #if?

#if TestMethod
...do this config
#else
...do this config
#endif

Maybe somehow detect the attribute of the unit test function?

+5
source share
2 answers

, , . , , "" . .

, , ?

+11

; . , , () , , - . , , , , .

0

All Articles