コード例 #1
0
        public void TestMethodAddSingleItem()
        {
            Catalog catalog = new Catalog();
            string[] parameters = new string[] { "Academy", "Telerik", "3", "http://telerikacademy.com/" };
            CatalogContent item = new CatalogContent(ContentTypes.Movie, parameters);
            catalog.Add(item);
            var result = catalog.GetTitlesList();

            Assert.AreEqual(result.Count(), 1);
        }
コード例 #2
0
        public void TestMethodAddMultipleItems1()
        {
            Catalog catalog = new Catalog();
            string[] parameters1 = new string[] { "Academy", "Telerik", "3", "http://telerikacademy.com/" };
            string[] parameters2 = new string[] { "Academy", "Telerik", "3", "http://telerikacademy.com/cources/" };

            CatalogContent item1 = new CatalogContent(ContentTypes.Movie, parameters1);
            CatalogContent item2 = new CatalogContent(ContentTypes.Movie, parameters2);
            catalog.Add(item1);
            catalog.Add(item2);

            var result = catalog.GetTitlesList().KeyValuePairs;

            Assert.AreSame(result.Last().Value, item2);
        }