If this is for unit tests only, I'd rather see this as a getFields function in the unit test file, since the test code can just as easily reach into the dialog object and pull out what it needs.

Not a big deal, though, if you feel differently.