Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Unit testing Prism ClearPopupStackAsync

$
0
0

We are developing a Xamarin Forms (4.1.0.778454) application using Prism (7.1.0.431). While writing unit test cases using NUnit and Moq, the following error occurred when the code reaches the statement "_navigationService.ClearPopupStackAsync".

System.InvalidOperationException: 'You MUST install Rg.Plugins.Popup to each project and call Rg.Plugins.Popup.Popup.Init(); prior to using it.

The instance of INavigationService is supplied by constructor injection. So that, in unit tests we are using Mock objects of INavigationService.

While analyzing, I found that ClearPopupStackAsync is an extension method, so that it cannot be mocked. Can anyone suggest some alternative for mocking?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>