I get the impression these days that writing macOS apps is pretty much a dead end unless you're a huge software company. There is practically no information available for testing that isn't related to iOS. Try searching google on the topic with a "-iOS" switch and you'll get nothing.
Are you creating an app test or a library test? (Testing with Xcode explains that terminology.) If you’re creating a library test you should refactor your library code that it’s not dependent on the app delegate. If you’re creating an app test, the app delegate should be up and running within your app at the time that your test code runs.
ps One of the reasons why there’s not a lot of Mac-specific stuff in this space is that the way that tests run is very similar on both platform. For example, the distinction between app and library tests is the same on both platforms.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks eskimo. I was really trying to avoid coming to that conclusion, but I can see that it's the right way to go. I was, indeed, more interested in a library test, so I've refactored my code to remove direct references to any GUI controllers. One day, time permitting (LOL!) I'll do some GUI tests, but I think it's more important to make sure the library is properly tested.