コード例 #1
0
 public void GIVEN_new_list_WHEN_getNext_called_THEN_returns_HackerNews_url()
 {
     var list = new UrlList();
     var webpage = list.GetNext();
     Assert.AreEqual("http://news.ycombinator.com", webpage.Url);
     Assert.AreEqual(Webpage.DefaultTimeout, webpage.Timeout);
 }
コード例 #2
0
 public ScreensaverForm(int thisDisplayId, UrlList list)
 {
     InitializeComponent();
     // Assign the number to an accessible variable
     _thisDisplayIdId = thisDisplayId;
     _view = new WebpageView(list);
     LostFocus += (o, e) => Close();
 }
コード例 #3
0
 public void GIVEN_list_with_3_urls_WHEN_getNext_called_THEN_returns_urls_in_sequence()
 {
     var list = new UrlList(new[] { "http://www.slb.com", "http://www.google.com", "http://whatthecommit.com" });
     Assert.AreEqual("http://www.slb.com", list.GetNext().Url);
     Assert.AreEqual("http://www.google.com", list.GetNext().Url);
     Assert.AreEqual("http://whatthecommit.com", list.GetNext().Url);
     Assert.AreEqual("http://www.slb.com", list.GetNext().Url);
 }
コード例 #4
0
        public WebpageView(UrlList urlList)
        {
            _urlList = urlList;

            _webBrowser.Dock = DockStyle.Fill;
            _webBrowser.DocumentCompleted += OnWebBrowserDocumentCompleted;
            _webBrowser.PreviewKeyDown += (o, e) => OnPreviewKeyDown(e);
            _webBrowser.ScriptErrorsSuppressed = true;
            Controls.Add(_webBrowser);
            _webBrowser.Dock = DockStyle.Fill;
            Load += OnLoad;

            _nextPageTimer.Interval = Config.Timeout;
            _nextPageTimer.Tick += OnNextPageTimerTimeout;
        }
コード例 #5
0
        public WebpageView(UrlList urlList)
        {
            _urlList = urlList;

            _webBrowser.Dock = DockStyle.Fill;
            _webBrowser.DocumentCompleted     += OnWebBrowserDocumentCompleted;
            _webBrowser.PreviewKeyDown        += (o, e) => OnPreviewKeyDown(e);
            _webBrowser.ScriptErrorsSuppressed = true;
            Controls.Add(_webBrowser);
            _webBrowser.Dock = DockStyle.Fill;

            _timer.Interval = 2000;
            _timer.Tick    += OnTimerTick;
            _timer.Start();
        }
コード例 #6
0
        public WebpageView(UrlList urlList)
        {
            _urlList = urlList;

            _webBrowser.Dock = DockStyle.Fill;
            _webBrowser.DocumentCompleted += OnWebBrowserDocumentCompleted;
            _webBrowser.PreviewKeyDown += (o, e) => OnPreviewKeyDown(e);
            _webBrowser.ScriptErrorsSuppressed = true;
            Controls.Add(_webBrowser);
            _webBrowser.Dock = DockStyle.Fill;

            _timer.Interval = 2000;
            _timer.Tick += OnTimerTick;
            _timer.Start();
        }
コード例 #7
0
 public void GIVEN_list_with_one_url_WHEN_getNext_called_twice_THEN_returns_same_url()
 {
     var list = new UrlList(new[] { "http://www.slb.com" });
     Assert.AreEqual("http://www.slb.com", list.GetNext().Url);
     Assert.AreEqual("http://www.slb.com", list.GetNext().Url);
 }