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

Mocking Xamarin DependencyService Injection for Unit Tests

$
0
0

How is this even possible? The only way I can see to call DS is via class methods, there is no container I can even register a Mock instance of, constructor injection also seems impossible (these are ViewModels that are injected with services via Autofac)

We Mock all of our services that we use via Autofac quite easily, but since the cross platform ones are "registered" in Xam Forms via Attributes this has suddenly become seemingly very hard.

Any ideas?

Thanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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