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

            messageViewModel.GetConversations().Wait();

            Assert.That(messageViewModel.Conversations, Is.Not.Empty);
        }
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

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

                PresentViewController(alert, true, null);
            }
        }