XAM320 CLASS - MVVM - Exercise 5 (UnitTests) Test Failing to Debug or Run

dinobdinob USUniversity ✭✭✭

Has anyone being able to complete XAM320 Exercise 5 dealing with UnitTests using the provided steps on Xamarin Studio?
I am on
-Xamarin.Forms 2.3.4.231
-AutoFixture 3.50.2
-NUnit 3.6.1
-Xamarin.Studio 6.5

I had following issue when following exercise 5 steps:
My GreatQuotes.Tests project builds but I observe following:
1) Running 1 single test (based on steps provided in exercise 5, there is only one test), test fails but it should pass
2) Attempt to debug the test will end up in Disassembly window eventually and eventually pop up error "Debugger operation failed" (screenshot attached). I have noticed that the Setup() method will never reach its end and it seem to be failing on either call to register QuoteLoaderStub or NavigationServiceStub, not sure which one as Disassembler window kicks in. (Screenshots provided)

I had following issue when trying to use provided app in Completed and Final folders of Exercise 5 lab materials:
I also tried running the version provided in Completed and in Final folders or Exercise 5 lab material but the GreatQuotes.Tests project in these would not even load in Xamarin.Studio. If I hover over it in the solution tree, it says "Not supported in Xamarin.Studio". I did however uncomment the line for using NUnit tests in MainViewModelTest.cs class.

It seems that the lab is having quite inaccurate / incomplete steps (similar is for last portion of Excercise 4)

Answers

  • Adrian.StevensAdrian.Stevens USXamarin Team, University, XamUProfessors, Developer Group Leader Xamurai

    The completed solution uses MSTest which is only supported on Visual Studio for Windows.

    You can complete the exercise on a Mac, you'll just create an NUnit project instead.

    Hope this helps!

  • dinobdinob USUniversity ✭✭✭
    Thanks Adrian but I'm aware test offers solution for both mstest and nunit. I was trying above mentioned using the uncommented nunit and commented out mstest solution
Sign In or Register to comment.