public void AddWeekdagTest()
        {
            ReservatieAbstr x = new Blokkering();

            x.AddWeekdag(true, true, false, false, false);
            Assert.AreEqual(2, x.Weekdagen.Count);
        }
        public ActionResult AddBlokkering(Gebruiker gebruiker, int aantal, int id, string datum , bool maandag = false , bool dinsdag = false, bool woensdag = false, bool donderdag = false, bool vrijdag = false)
        {
            
            try
            {
                Product prod = productRepository.FindByProductNummer(id);
                DateTime date = Helper.ZetDatumOm(datum);
                ReservatieAbstr blokkering = new Blokkering(prod, aantal, gebruiker, date);
                blokkering.AddWeekdag(maandag, dinsdag, woensdag, donderdag, vrijdag);
                gebruiker.VoegReservatieAbstrToe(blokkering);
                            gebruikerRepository.SaveChanges();
                            TempData["Info"] = "Product " + productRepository.FindByProductNummer(id).Naam + " is geblokkeerd.";
                      

            }
            catch (ArgumentException e)
            {
                TempData["ReservatieFail"] = e.Message;
            }
            catch
            {
                TempData["ReservatieFail"] = "Blokkering toevoegen is niet gelukt";


            }


            return RedirectToAction("Index");
        }
示例#3
0
 public void TestBlokkeringConstructorArgumentExeption()
 {
     int        aantal  = 1;
     Product    product = new Product();
     Gebruiker  student = new Student();
     DateTime   datum   = DateTime.Now;
     Blokkering x       = new Blokkering(product, aantal, student, datum);
 }
示例#4
0
 public void Initialize()
 {
     blokkering = new Blokkering();
 }