'How do I fix Init() error when unit testing a method that builds a new instance of a view, that contains a listview
I have a custom navigation method that builds a new instance of a view. Unit tests for this method fail with the error message
System.InvalidOperationException: You must call Xamarin.Forms.Forms.Init(); prior to using this property.
I know that the listview in the view is causing it as the unit tests succeed when the listview is removed.
I have seen in older posts and blogs that this is because platformServices needs to be set but this cannot be set externally and the solutions point to github repositories or nuget packages that no longer exist or don't go into detail.
Any advice would be appreciated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
