Esempio n. 1
0
        public void Test401_LinqTest()
        {
            domain.SaveFavoriteLink(_profileId1, "http://abclink.com", "ABC Link");
            domain.SaveFavoriteLink(_profileId1, "http://deflink.com", "DEF Link");
            domain.SaveFavoriteLink(_profileId1, "http://ghilink.com", "GHI Link");

            FavoriteLinkCollection links          = domain.GetLatest20FavoriteLinkCollection(_profileId1);
            FavoriteLinkCollection filteredLinks1 = LinqHelper.GetFilteredLinks(links, "abc");

            Assert.IsTrue(filteredLinks1.Count == 1, "There should be just 1 result");
            Console.WriteLine("ABC Link:");
            foreach (FavoriteLink favoriteLink in filteredLinks1)
            {
                Console.WriteLine(favoriteLink.Url);
            }

            FavoriteLinkCollection filteredLinks2 = LinqHelper.GetFilteredLinks(links, "link.com");

            Assert.IsTrue(filteredLinks2.Count == 3, "There should be just 3 results");
            Console.WriteLine("All Links:");
            foreach (FavoriteLink favoriteLink in filteredLinks2)
            {
                Console.WriteLine(favoriteLink.Url);
            }
        }
Esempio n. 2
0
        public FavoriteLinkDataContract[] GetLatest20FavoriteLinkCollection(
            long profileId)
        {
            Trace.WriteLine("GetLatest20FavoriteLinkCollection");
            FavoriteLinkDomain     domain        = new FavoriteLinkDomain();
            FavoriteLinkCollection favoriteLinks =
                domain.GetLatest20FavoriteLinkCollection(profileId);

            return(GetFavoriteLinksArray(favoriteLinks));
        }