[Tests] Avoid NRE in MediaItemTest.DefaultValues test

https://bugzilla.xamarin.com/show_bug.cgi?id=49978

MPMediaQuery.Item will be null if Media Library privacy access dialog
is not granted
This commit is contained in:
Alex Soto 2016-12-15 13:01:26 -06:00
Родитель c267c5668c
Коммит df9c52914d
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -29,6 +29,8 @@ namespace MonoTouchFixtures.MediaPlayer {
using (var q = new MPMediaQuery ()) {
var items = q.Items;
if (items == null)
Assert.Inconclusive ("This test needs media library privacy permission to be executed.");
if (items.Length == 0)
Assert.Inconclusive ("This test needs music in the music library on the device.");