public void Test1(int[] array, int expected) { IAPService apService = new APService(); int result = apService.Task1(array); Assert.Equal(expected, result); }
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, System.Action <UIBackgroundFetchResult> completionHandler) { APService.HandleRemoteNotification(userInfo); Window.BackgroundColor = UIColor.Red; MsgBoxHelper.ShowMessage("接收到推送的消息", new string(userInfo.SelectMany(kv => string.Format("'{0}': '{1}' \n", kv.Key, kv.Value)).ToArray())); if (completionHandler != null) { completionHandler(UIBackgroundFetchResult.NewData); } }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { // Override point for customization after application launch. // If not required for your application you can safely delete this method // Code to start the Xamarin Test Cloud Agent MsgBoxHelper.Initialize(this); APService.RegisterForRemoteNotificationTypes( (uint)(UIUserNotificationType.Alert | UIUserNotificationType.Sound | UIUserNotificationType.Badge), null); APService.SetupWithOption(launchOptions); APService.SetDebugMode(); return(true); }
public void Test2(byte[] array1, byte[] array2, byte[] expected) { IAPService apService = new APService(); LinkedList <byte> list1 = new LinkedList <byte>(array1); LinkedList <byte> list2 = new LinkedList <byte>(array2); LinkedList <byte> result = apService.Task2(list1, list2); Assert.Equal(expected.Length, result.Count); int i = 0; foreach (var e in result) { Assert.Equal(expected[i], e); i++; } }
public void Test3(string phrase, bool expected) { IAPService apService = new APService(); Assert.Equal(expected, apService.Task3(phrase)); }
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken) { APService.RegisterDeviceToken(deviceToken); }