/// <summary>
 /// Maak een bestelling aan
 /// Wanneer de klant een bezoeker of lid is wordt deze bestelling automatisch aan de klant toegevoegd
 /// </summary>
 /// <param name="bestellingsID"></param>
 /// <param name="klant"></param>
 public Bestelling(Persoon klant, Bioscoopvertoning bioscoopvertoning, Stoel stoel)
 {
     Klant             = klant ?? throw new ArgumentNullException();
     Bioscoopvertoning = bioscoopvertoning ?? throw new ArgumentNullException();
     Stoel             = stoel ?? throw new ArgumentNullException();
     if (klant is Bezoeker)
     {
         (klant as Bezoeker).VoegBestellingToe(this);
     }
     if (klant is Lid)
     {
         (klant as Lid).VoegBestellingToe(this);
     }
     bioscoopvertoning.VoegBestellingToe(this);
 }
Example #2
0
        public void TestBioscoopvertoningBestellingToevoegenIncorrect()
        {
            string            titel              = "Avengers: Infinity war";
            int               jaar               = 2018;
            int               speelduur          = 149;
            string            taal               = "Engels";
            int               leeftijdscategorie = 12;
            List <Film.Genre> lijstGenres        = new List <Film.Genre>();

            lijstGenres.Add(Film.Genre.Actiefilm);
            lijstGenres.Add(Film.Genre.Avontuurfilm);
            lijstGenres.Add(Film.Genre.Sciencefiction);
            DateTime begintijd = DateTime.Now;

            Bioscoopvertoning.Filmkwaliteit filmkwaliteit = Bioscoopvertoning.Filmkwaliteit._Imax_3D;
            Zaal zaal = new Zaal(1, Bioscoopvertoning.Filmkwaliteit._Imax_3D, 20, 30, 2, 20);

            Bioscoopvertoning b   = new Bioscoopvertoning(titel, jaar, speelduur, taal, leeftijdscategorie, lijstGenres, begintijd, filmkwaliteit, zaal);
            Bestelling        bes = null;

            b.VoegBestellingToe(bes);
        }