예제 #1
0
        public void GetFriendsSuccessfully()
        {
            //Simulate login
            settings.User = new User();

            friendViewModel.GetFriends().Wait();

            Assert.That(friendViewModel.Friends, Is.Not.Empty);
        }
예제 #2
0
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            try
            {
                Task.Run(async() =>
                {
                    await friendViewModel.GetFriends();
                    InvokeOnMainThread(() => TableView.ReloadData());
                });
            }
            catch (Exception ex)
            {
                var alert = UIAlertController.Create("Friends Failure", ex.Message, UIAlertControllerStyle.Alert);
                alert.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));

                PresentViewController(alert, true, null);
            }
        }