03-21-2023 09:17 AM
Is there a cleaner way to unit test public class methods which use state data contained in the class private ctl other than have the test VIs be members of the class itself?
If that is the only way, can those test VIs be stripped out of the class easily during a build in the same way you can exclude unused members from libraries? I.e., does application builder treat lvclass files as "libraries" with that option?
Solved! Go to Solution.
03-21-2023 10:09 AM
You could make the private data community scoped instead and put all of your unit tests in a library that is friends with that class.
I know in LabVIEW's class hierarchy classes are a child of the library class so I would expect excluding unused members would work but I don't know for sure.
03-22-2023 02:19 PM
Community scoped as in add accessors which are community scoped?
03-22-2023 02:20 PM
Exactly
03-22-2023 02:27 PM
Hmm, I was hoping to avoid having to make accessors for that. It would be nice if LV classes allowed you to directly define private, public, protected, etc. class data as additional .ctls under the class which could then just be unbundled by VIs of the required scope.
03-22-2023 02:44 PM
When you create an accessor there is a box which allows access through property nodes. You might have known that already but it's similar to what you were asking for with the unbundle.