Bug 58569 - Unit tests fail after upgrade to XF 2.3.5
Summary: Unit tests fail after upgrade to XF 2.3.5
Status: RESOLVED DOWNSTREAM
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-03 12:34 UTC by Michel Moorlag
Modified: 2017-08-03 15:14 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DOWNSTREAM

Description Michel Moorlag 2017-08-03 12:34:18 UTC
I have a Xamarin Forms 2.3.4.247 solution with a unit tests project using Moq (https://www.nuget.org/packages/Moq/) version 4.7.99. All unit tests run fine.

After upgrading Xamarin Forms to version 2.3.5.256-pre6 I have rebuild my solution. Now when I try to run the unit tests in the ClassInitialize method on line "Xamarin.Forms.Mocks.MockForms.Init();" I get the exception:
Could not load type 'Xamarin.Forms.IPlatformServices' from assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.

I am not sure if this is a Moq or XF problem.
Comment 1 Michel Moorlag 2017-08-03 12:59:44 UTC
Found it, version 2.3.5 is not support (yet?) by Xamarin.Forms.Mocks.
From the documentation in https://github.com/jonathanpeppers/Xamarin.Forms.Mocks/

Xamarin.Forms	Xamarin.Forms.Mocks
2.3.4.x	2.3.4.x
2.3.3.x	2.3.3.1
2.3.0-2.3.2	0.1.0.4
Older	Unsupported


This issue can be closed
Comment 2 Michel Moorlag 2017-08-03 13:09:56 UTC
Added an issue there, see:
https://github.com/jonathanpeppers/Xamarin.Forms.Mocks/issues/7