Exemple #1
0
// ***** Read
        private void ShowAll()
        {
            List <StreamingContent> listContent = _repo.GetContents();

            foreach (StreamingContent content in listContent)
            {
                DisplayContent(content);
            }
            Console.ReadKey();
        }
Exemple #2
0
        public void Arrange()
        {
            _repo = new CT_Repo();
            StreamingContent newMovie1 = new StreamingContent(
                "Nerd Quest",
                "Sci-fi movie - comedy",
                MaturityType.PG13,
                3,
                GenreType.SciFi);

            _repo = new CT_Repo();
            StreamingContent newMovie2 = new StreamingContent(
                "Hitchhikers Guide",
                "Weird space comedy",
                MaturityType.R,
                5,
                GenreType.Comedy);

            _repo = new CT_Repo();
            StreamingContent newMovie3 = new StreamingContent(
                "Unforgiven",
                "Dark western",
                MaturityType.R,
                5,
                GenreType.Western);

            _repo.AddContentToDirectory(newMovie1);
            _repo.AddContentToDirectory(newMovie2);
            _repo.AddContentToDirectory(newMovie3);

            _content = new StreamingContent();

            StreamingContent newMovie4 = new StreamingContent(
                "WTH",
                "Mystery",
                MaturityType.G,
                2,
                GenreType.Horror);

            _repo.AddContentToDirectory(_content);
            Console.WriteLine("Anything here now?");

            Console.WriteLine(_repo.ContentCount);
            Console.WriteLine("Titles : " + _repo.GetContents());
            List <StreamingContent> family = _repo.GetFamily();

            foreach (StreamingContent movie in family)
            {
                Assert.IsTrue(movie.IsFamilyFriendly);
            }
            Assert.AreEqual(2, family.Count);

            Show show = new Show();

            show.Title       = "The New Show";
            show.SeasonCount = 4;

            Episode episode1 = new Episode();

            episode1.Title = "Roadwarrior";
            Episode episode2 = new Episode();

            episode2.Title = "Dingus";

            _repo.AddContentToDirectory(show);
        }