Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

System.Exception reporting a catastrophic failure when NUnit runner loads tests and project to be tested #56

Open
cmurczek opened this issue Jun 1, 2016 · 3 comments

Comments

@cmurczek
Copy link

cmurczek commented Jun 1, 2016

I'm developing a Xamarin project (iOS, Android, UWP). Both, the actual projects as well as the test projects use the shared project approach. When i run my tests (i.e. one Test with Assert.Pass()), the test project takes a nose dive throwing a System.Exception in the constructor of the MainPage (specifically the call to LoadApplication(nunit) to which the NUnit.Runner.App is passed to fails), reporting that App of my project returned a catastrophic failure. when I remove the reference to my project test run fine. I am also able to start my project standalone.

I've been trying to hunt this down ever since i submitted this PR, but I'm running out of ideas. Any help appreciated.

@rprouse
Copy link
Member

rprouse commented Jun 1, 2016

Does this happen on all platforms? Are there any clues in the Exception message or inner exceptions? Any clues in the Output window of Visual Studio?

@cmurczek
Copy link
Author

cmurczek commented Jun 2, 2016

After removing and readding the test projects for Android and UWP a billion times, I finally got Android working. However, the UWP test project now consistently complains about duplicate resources, this time its Xamarin.Forms.Platform.UAP/Resources.xbf.
The exception did not provide any details other than the catastrophic failure message.
Next thing I'll try is to use a regular NUnit test project for my UWP project. That way there can't be any conflicts resulting from Xamarin resources. Dead end.

BTW, I found that NUnit.Runner introduces a "Hello" string resource in the Android project that is no where used. Sadly it is not provided with an id in the generated Resource.Designer.cs, thus causing a compilation error. I couldn't find it in the code of the droid runner project. Workaround is to create a strings.xml in resources and defining the string Hello there. I'll raise a separate issue to track that.

@cmurczek
Copy link
Author

cmurczek commented Jun 2, 2016

In a last desperate attempt I upgraded Xamarin to 2.2.0.45. This brought back the Hello resource string issue, however using the workaround it's looking good. My UWP test project is crashing again (catastrophic failure). At least when I run it locally, i.e. on my computer, which is the only thing I can do since the Android Emulator messed up my config so that the Win Mobile Emulator no longer connects to the VM. Loving it :-|
I have uploaded my code in case you want to use it for reproducing/debugging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants