Unit testing FFImageLoading and calling CachedImageRenderer.Init?

LeloLelo Member ✭✭✭

I am trying to create unit test that calls methods that are dependent of FFImageLoading.Forms.CachedImage
. I get this exception:
System.Exception: Please call CachedImageRenderer.Init method in a platform specific project to use FFImageLoading!
How can I call this method from a test project? Will I have to create platform specific code snippet that calls init? Or is there any other way around it?

Answers

  • ElandaloussiishrakElandaloussiishrak USMember ✭✭

    Add
    CachedImageRenderer.Init(); in "OnCreate" function in MainActivity.cs class of your android project
    and in FinishedLaunching function in AppDelegate class of your iOS project

  • LeloLelo Member ✭✭✭

    @Elandaloussiishrak said:
    Add
    CachedImageRenderer.Init(); in "OnCreate" function in MainActivity.cs class of your android project
    and in FinishedLaunching function in AppDelegate class of your iOS project

    I have already done that. But I wonder how to call methods depending on CacheImage from MsTest or xUnit test project?

Sign In or Register to comment.