public void getMovieByIdTest()
        {
            var result = BlockBusterBasicFunctions.GetMovieById(11);

            Assert.True(result.Title == "Vertigo");
            Assert.True(result.ReleaseYear == 1958);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var    b  = BlockBusterBasicFunctions.GetAllMovies();
            var    oh = new OutputHelper();
            string ans;
            bool   incorrect = true;

            Console.WriteLine("would you like the output as a CSV or written into the console? ( type: CSV or cons)");


            do
            {
                ans = Console.ReadLine();

                if (ans == "CSV")
                {
                    oh.WriteToCSV(b);
                    incorrect = false;
                }
                else if (ans == "cons")
                {
                    oh.WriteToConsole(b);
                    incorrect = false;
                }
                else
                {
                    Console.WriteLine("ERROR* Not a valid input please try again and type CSV or cons");
                }
            } while (incorrect);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var b  = BlockBusterBasicFunctions.GetAllMovies();
            var oh = new OutputHelper();

            oh.WriteToCSV(b);
        }
Esempio n. 4
0
        // GET: AdminController/Edit/5
        public ActionResult Edit(int id)
        {
            var movie = BlockBusterBasicFunctions.GetFullMovieById(id);

            ViewBag.GenreId    = DropDownFormatter.FormatGenres();
            ViewBag.DirectorId = DropDownFormatter.FormatDirectors();
            return(View(movie));
        }
        public void getAllCheckedOutMoviesTest()
        {
            var result = BlockBusterBasicFunctions.GetAllCheckedOutMovies();

            Assert.True(result.Count == 3);
        }
        public IActionResult Movies()
        {
            var movieList = BlockBusterBasicFunctions.GetAllMoviesFull();

            return(View(movieList));
        }
        // GET: AdminController/Delete/5
        public ActionResult Delete(int id)
        {
            var movie = BlockBusterBasicFunctions.GetFullMovieById(id);

            return(View(movie));
        }
Esempio n. 8
0
 public static SelectList FormatGenres()
 {
     return(new SelectList(BlockBusterBasicFunctions.GetAllGenres()
                           .OrderBy(g => g.GenreDescr)
                           .ToDictionary(g => g.GenreId, g => g.GenreDescr), "Key", "Value"));
 }
Esempio n. 9
0
 public static SelectList FormatDirectors()
 {
     return(new SelectList(BlockBusterBasicFunctions.GetAllDirectors()
                           .OrderBy(d => d.LastName)
                           .ToDictionary(d => d.DirectorId, d => d.LastName + ", " + d.FirstName), "Key", "Value"));
 }
Esempio n. 10
0
        public void GetAllMoviesByDirectorLastName()
        {
            var result = BlockBusterBasicFunctions.GetAllMoviesByDirectorLastName();

            Assert.True(result.Count == 50);
        }
Esempio n. 11
0
        public void GetAllMoviesByGenreDescription()
        {
            var result = BlockBusterBasicFunctions.GetAllMoviesByGenreDescription();

            Assert.True(result.Count == 50);
        }
        public void GetByDirectorsLast()
        {
            var result = BlockBusterBasicFunctions.GetByDirectorsLast("Eastwood");

            Assert.True(result.Count == 28);
        }
        public void GetMoviesByGenreDescr()
        {
            var directorlast = BlockBusterBasicFunctions.GetMoviesByGenreDescr("Action");

            Assert.True(directorlast.Count == 5);
        }