private void InfoSpectacol_Click(object sender, MouseButtonEventArgs e) { Spectacol s = view.getSpectacol(); if (s != null) { List <DistributieOp> l_distributie_op = spectacolRepo.getActoriOp(s); string str = s.ToString(); if (l_distributie_op.Count != 0) { str += "\n\nDistributie\n"; foreach (DistributieOp d in l_distributie_op) { str = str + "Actor: " + d.NumeActor + ", Rol: " + d.RolActor + "\n"; } view.showMessage(str); } else { List <DistributieBalet> l_distributie_balet = spectacolRepo.getActoriBalet(s); str += "\n\nDistributie\n"; foreach (DistributieBalet d in l_distributie_balet) { str = str + d.NumeActor + "\n"; } view.showMessage(str); } } }
public void test5() { //update spectacol Spectacol s = new Spectacol(); s.IdSpectacol = 6; s.Titlu = "Boema"; s.Regia = "Ina Hudea"; s.Gen = "Operă"; s.DataPremiere = "2018-12-27 18:00:00"; s.NumarBilete = 125; //am schimbat numarul biletelor _spectacolRepo.operatiiSpectacol(s, 1); //update List <Spectacol> ls = _spectacolRepo.getSpectacole(); Spectacol stest = ls.Where(x => x.Titlu == s.Titlu).SingleOrDefault(); s.DataPremiere = "27.12.2018 18:00:00"; Assert.IsTrue(stest.ToString() == s.ToString()); }
public void test4() { //insert spectacol Spectacol s = new Spectacol(); s.Titlu = "Boema"; s.Regia = "Ina Hudea"; s.Gen = "Operă"; s.DataPremiere = "2018-12-27 18:00:00"; s.NumarBilete = 75; _spectacolRepo.operatiiSpectacol(s, 0);//insert List <Spectacol> ls = _spectacolRepo.getSpectacole(); Spectacol stest = ls.Where(x => x.Titlu == s.Titlu).SingleOrDefault(); s.IdSpectacol = 6; s.DataPremiere = "27.12.2018 18:00:00"; //System.Windows.MessageBox.Show(stest.ToString()); //System.Windows.MessageBox.Show(s.ToString()); Assert.IsTrue(stest.ToString() == s.ToString()); }