How to set up ServiceLocationProvider for unit testing navigation in Prism?

A Prism/Unity application I'm working on has a view that is in charge of implementing the .GoBack and .GoForward methods of RegionNavigationJournal. This will be the first time I'll need to unit test anything that uses the RegionManager, and I'm running into an error advising that "ServiceLocationProvider must be set" when I try to locate the region whose navigation is being controlled (which is a different region than the one the view in question belongs to).

Based on this I've done some digging and haven't come across anything about resolving the ServiceLocationProvider error in the context of Prism navigation. If possible I'd prefer avoiding mocking anything, but if that ends up being the only/best option it's not out of the question.

If there's more information I can include please let me know. Thanks for any insight you can provide!

by Vartib via /r/csharp

Leave a Reply