You could refactor this into a method in the type and call into that as part of your test.