lundi 8 août 2016

Xamarin unit tests :Xamarin.Forms.Init() must be called prior to using it

I am new to xamarin. I am working on automating unit tests using Nunitlite and Xamarin TestSuitInstrumentation.

Many of my test cases are failing in instrumentation with below error "Error : java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference "

and some test cases with "[Xamarin.Forms] Xamarin.Forms.Init() must be called prior to using it"

In Nunit Main activity , Forms.init() is called, but how can I call the same from TestsuiteInstrumentation class..??? I am assuming that error is because Forms.init is not called.

Please someone help me.

Aucun commentaire:

Enregistrer un commentaire