Question: write Junit test for the following source code: using Acr.UserDialogs; using Covid19Radar.Resources; using Newtonsoft.Json.Linq; using System; using System.Diagnostics; using System.Net.Http; using Xamarin.Essentials; using Xamarin.Forms; namespace
write Junit test for the following source code: using Acr.UserDialogs; using Covid19Radar.Resources; using Newtonsoft.Json.Linq; using System; using System.Diagnostics; using System.Net.Http; using Xamarin.Essentials; using Xamarin.Forms; namespace Covid19Radar.Common { static class AppUtils { public static async void CheckPermission() { var status = await Permissions.CheckStatusAsync(); if (status != PermissionStatus.Granted) { status = await Permissions.RequestAsync(); } } public static async void PopUpShare() { if (Device.RuntimePlatform == Device.iOS) { await Share.RequestAsync(new ShareTextRequest { Uri = AppSettings.Instance.AppStoreUrl, Title = Resources.AppResources.AppName }); } else if (Device.RuntimePlatform == Device.Android) { await Share.RequestAsync(new ShareTextRequest { Uri = AppSettings.Instance.GooglePlayUrl, Title = Resources.AppResources.AppName }); } } public static async void CheckVersion() { var uri = AppResources.UrlVersion; using (var client = new HttpClient()) { try { var json = await client.GetStringAsync(uri); var versionString = JObject.Parse(json).Value("version"); if (versionString != AppInfo.VersionString) { await UserDialogs.Instance.AlertAsync(AppResources.AppUtilsGetNewVersionDescription, AppResources.AppUtilsGetNewVersionTitle, Resources.AppResources.ButtonOk); if (Device.RuntimePlatform == Device.iOS) { await Browser.OpenAsync(AppSettings.Instance.AppStoreUrl, BrowserLaunchMode.External); } else if (Device.RuntimePlatform == Device.Android) { await Browser.OpenAsync(AppSettings.Instance.GooglePlayUrl, BrowserLaunchMode.External); } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } finally { } } } } } Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
