Example #1
0
        public void TestIndexer()
        {
            Favorite            f1 = new Favorite("Home", new Uri("https://www.it-tallaght.ie"));
            Favorite            f2 = new Favorite("About Us", new Uri("https://www.it-tallaght.ie"));
            FavoritesCollection fc = new FavoritesCollection();

            fc.AddFavorite(f1);
            fc.AddFavorite(f2);

            List <Favorite> favoriteList = new List <Favorite>();

            favoriteList.Add(f1);

            // Indexer adding based on name
            List <Favorite> nameList = new List <Favorite>();

            foreach (Favorite f in fc)
            {
                if (f.Name == "Home")
                {
                    nameList.Add(f);
                }
                else
                {
                    break;
                }
            }
            // checks both lists are equal
            CollectionAssert.AreEqual(favoriteList, nameList);
        }
Example #2
0
        public void TestAddFavorite2()
        {
            Favorite            f1 = new Favorite("Home", new Uri("https://www.it-tallaght.ie"));
            FavoritesCollection fc = new FavoritesCollection();

            fc.AddFavorite(f1);
            fc.AddFavorite(f1);
        }
Example #3
0
        public void TestRemoveFavorite2()
        {
            Favorite            f1 = new Favorite("Home", new Uri("https://www.it-tallaght.ie"));
            Favorite            f2 = new Favorite("About Us", new Uri("https://www.it-tallaght.ie"));
            FavoritesCollection fc = new FavoritesCollection();

            fc.AddFavorite(f1);
            fc.AddFavorite(f2);
            fc.RemoveFavorite("Cool Things");
        }
Example #4
0
        public void TestAddFavorite1()
        {
            Favorite            f1 = new Favorite("Home", new Uri("https://www.it-tallaght.ie"));
            Favorite            f2 = new Favorite("About Us", new Uri("https://www.it-tallaght.ie"));
            FavoritesCollection fc = new FavoritesCollection();

            fc.AddFavorite(f1);
            fc.AddFavorite(f2);

            CollectionAssert.Contains(fc.FavoriteList, f1);
            CollectionAssert.Contains(fc.FavoriteList, f2);
        }
Example #5
0
        public MainPageViewModel()
        {
            WorldNews      = new ObservableCollection <News.NewsInformation>();
            TechnologyNews = new ObservableCollection <News.NewsInformation>();
            TrendingNews   = new ObservableCollection <News.NewsInformation>();
            Favorites      = new FavoritesCollection();

            CurrentUser = new UserInformation {
                DisplayName     = "Scott",
                BioContent      = "Scott has been developing Microsoft Enterprise solutions for organizations around the world for the last 28 years, and is the Senior Architect & Developer behind Liquid Daffodil.",
                ProfileImageUrl = "https://wintellectnow.blob.core.windows.net/public/Scott_Peterson.jpg"
            };
        }