public NewsListController (IntPtr handle) : base (handle) { this.Title = "Nachrichten"; this.TabBarItem.Image = UIImage.FromBundle ("third"); press = new Press (); this.NavigationItem.SetRightBarButtonItem ( new UIBarButtonItem ("Zurück", UIBarButtonItemStyle.Done, delegate(object sender, EventArgs e) { var initialViewController = Storyboard.InstantiateInitialViewController () as UIViewController; NavigationController.NavigationBarHidden = true; NavigationController.PushViewController (initialViewController, true); }), true); }
public void CallbackOfPressMethodWillBeCalled() { bool calledBack = false; List<News> res = new List<News>(); var sut = new Press(); sut.RaiseRetreivedNewsItems += (sender, e) => { calledBack = true; res = e.News; }; sut.FireEventForNews(); for (int i = 0; (i < 10) && !calledBack; i++) { Thread.Sleep(1000); } Assert.IsTrue(res.Count > 1); }
public async void PressWillCallBackWithNewsListSpecified() { var sut = new Press(); var res = await sut.GetNews(); Assert.IsTrue(res.Count > 1); }
private void ReachToPress() { _press = new Press(); _fetcher.RaiseRetreivedNewsItem += (sender, e) => { AddNewsEntry(e.News); }; try { _fetcher.GetTimes((int)_settings.Read("group") + 1, Activity.GetNews); } catch { _fetcher.GetTimes(5, Activity.GetNews); } _news = new ObservableCollection<News>(); _press.RaiseRetreivedNewsItems += (sender, e) => { AddNewsEntrys(e.News); }; _press.FireEventForNews(); Newspanel.DataContext = _news; }