Esempio n. 1
0
 public void TestMethodAddSingleItem()
 {
     var catalog = new Catalog();
     string[] item = {
                        "Intro C#", 
                        "S.Nakov", 
                        "12763892", 
                        "http://www.introprogramming.info"
                        };
     var book = new ContentItem(ContentItemType.Book, item);
     catalog.Add(book);
     Assert.AreEqual(catalog.Count(), 1);
 }
Esempio n. 2
0
        public void TestMethodAddMultipleItems()
        {
            var catalog = new Catalog();
            var book = new ContentItem(ContentItemType.Book, new string[] {
                               "Intro C#","S.Nakov","12763892","http://www.introprogramming.info"});


            var movie = new ContentItem(ContentItemType.Movie, new string[] {
                               "The Secret","Sean Byrne & others (2006)","832763834","http://thesecret/movies/avi"});


            var song = new ContentItem(ContentItemType.Song, new string[] {
                               "The Secret Song","Sean Byrne & others (2006)","832763834","http://thesecret/songs/mp3"});

            catalog.Add(book);
            catalog.Add(movie);
            catalog.Add(song);
            Assert.AreEqual(catalog.Count(), 3);
        }
Esempio n. 3
0
        public void TestMethodAdd50kItems()
        {
            var catalog = new Catalog();
            for (int i = 0; i < 10000; i++)
            {
                var book = new ContentItem(ContentItemType.Book, new string[] {
                               "Intro C#" + i,"S.Nakov","12763892","http://www.introprogramming.info"});
                catalog.Add(book);
            }

            Assert.AreEqual(catalog.Count(), 10000);
        }