Beispiel #1
0
 public void AuthorTestProperty()
 {
     NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
         new Category(0, "category"), "author",
         "summary", new Uri("http://www.foo.bar"),
         new NewsSource("newssource", new Uri("http://www.foo.bar")));
     news.Author = "test";
     Assert.AreEqual("test", news.Author);
 }
Beispiel #2
0
        public void CategoryTestProperty()
        {
            NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
                new Category(0, "category"), "author", "summary",
                new Uri("http://www.foo.bar"),
                new NewsSource("newssource", new Uri("http://www.foo.bar")));
            news.Category = new Category(1, "test");

            Assert.AreEqual("test", news.Category.Name);
            Assert.AreEqual(1, news.Category.Id);
        }
Beispiel #3
0
        public void WordCountTestProperty()
        {
            NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
                new Category(0, "category"), "author", "summary",
                new Uri("http://www.foo.bar"),
                new NewsSource("newssource", new Uri("http://www.foo.bar")));
            news.WordCount = 42;

            Assert.AreEqual(42, news.WordCount);
        }
Beispiel #4
0
        public void UserFoundInterestingTestProperty()
        {
            NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
                new Category(0, "category"), "author", "summary",
                new Uri("http://www.foo.bar"),
                new NewsSource("newssource", new Uri("http://www.foo.bar")));
            news.UserFoundInteresting = true;

            Assert.AreEqual(true, news.UserFoundInteresting);

            news.UserFoundInteresting = false;

            Assert.AreEqual(false, news.UserFoundInteresting);

            news.UserFoundInteresting = null;

            Assert.AreEqual(null, news.UserFoundInteresting);
        }
Beispiel #5
0
        public void UrlTestProperty()
        {
            NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
                new Category(0, "category"), "author", "summary",
                new Uri("http://www.foo.bar"),
                new NewsSource("newssource", new Uri("http://www.foo.bar")));
            news.Url = new Uri("http://www.bar.foo");

            Assert.AreEqual(new Uri("http://www.bar.foo"), news.Url);
        }
Beispiel #6
0
        public void TermsTestProperty()
        {
            NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
                new Category(0, "category"), "author", "summary",
                new Uri("http://www.foo.bar"),
                new NewsSource("newssource", new Uri("http://www.foo.bar")));
            news.Terms = new List<Term> { new Term("foo"), new Term("bar") };

            Assert.AreEqual(2, news.Terms.Count);
        }
Beispiel #7
0
        public void IsReadTestProperty()
        {
            NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
                new Category(0, "category"), "author", "summary",
                new Uri("http://www.foo.bar"),
                new NewsSource("newssource", new Uri("http://www.foo.bar")));
            news.IsRead = true;

            Assert.AreEqual(true, news.IsRead);

            news.IsRead = false;

            Assert.AreEqual(false, news.IsRead);
        }
Beispiel #8
0
        public void DatePropertyTest()
        {
            NewsFilter.News.NewsItem news = new NewsFilter.News.NewsItem("title",
                new Category(0, "category"), "author", "summary",
                new Uri("http://www.foo.bar"),
                new NewsSource("newssource", new Uri("http://www.foo.bar")));
            news.Date = DateTime.MinValue;

            Assert.AreEqual(DateTime.MinValue, news.Date);
        }