xunit / devices.xunit

xUnit.net Runners for Devices
Other
73 stars 36 forks source link

Unable to install xunit.runner.devices #56

Closed weitzhandler closed 6 years ago

weitzhandler commented 7 years ago

Hello,

I'm trying to add a Xamarin.Forms test project.

I created a Xamarin.Forms PCL and when trying to install the xunit.runner.devices NuGet package, I get the following error:

Could not install package 'System.Runtime.InteropServices.RuntimeInformation 4.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.6,Profile=Profile44', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

What am I doing wrong?

aizefler commented 7 years ago

@weitzhandler , I am currently testing on this framework, and received the same message. To solve it I installed version 2.1 according to the documentation and it worked perfectly.

https://github.com/xunit/devices.xunit

I hope this helps.

clairernovotny commented 7 years ago

@weitzhandler The devices project does not support installing into a PCL... it is platform specific and is meant to be the "runner app" for iOS, UWP or Android. The tests can live in a PCL as you tell the runner app which assemblies contain tests.

aizefler commented 7 years ago

Hi @onovotny , thank you very much for your contribution and for your attention!

I have two doubts about using xUnit in Xamarin Forms applications along with Visual Studio Team Services in the build process.

First, it is about the location of the test classes, they must be together with the production classes and be published together with the final application, or it is possible to decouple them in separate projects, and can publish the application for end-user use without No xunit reference?

Second, can I run the tests in the VSTS build process?

clairernovotny commented 6 years ago

The tests reside in/with a different app that runs the tests. There's a template for this now.

It may be possible to run as part of VSTS if you look at what Xamarin Essentials is doing.