public void HasId() { #if WINDOWS_PHONE if (DeviceCapabilities.IsEnabled(DeviceCapabilities.Capability.ID_CAP_IDENTITY_DEVICE)) { Assert.IsFalse(string.IsNullOrEmpty(PlatformDevice.CurrentDevice.Id)); } else { Assert.ThrowsException <UnauthorizedAccessException>(() => PlatformDevice.CurrentDevice.Id); Assert.Inconclusive("Unable to get device ID since {0} has not been defined in app manifest.", Xamarin.Forms.Labs.DeviceCapabilities.Capability.ID_CAP_IDENTITY_DEVICE); } #else Assert.IsFalse(string.IsNullOrEmpty(PlatformDevice.CurrentDevice.Id)); #endif }
public void HasMediaPicker() { #if WINDOWS_PHONE if (DeviceCapabilities.IsEnabled(DeviceCapabilities.Capability.ID_CAP_ISV_CAMERA)) { Assert.IsNotNull(PlatformDevice.CurrentDevice.MediaPicker); } else { Assert.ThrowsException <UnauthorizedAccessException>(() => PlatformDevice.CurrentDevice.MediaPicker); Assert.Inconclusive("Unable to initialize MediaPicker since {0} has not been defined in app manifest.", DeviceCapabilities.Capability.ID_CAP_ISV_CAMERA); } #else Assert.IsNotNull(PlatformDevice.CurrentDevice.MediaPicker); #endif }