public void WhenFilmsArePresentThenTheyShouldBeInTheResultingList() { Assert.That(_repository.GetAll().Result, Is.EqualTo(RepositoryResult.Failed)); }
public List <Film> GetAll() { return(filmDal.GetAll().Select(x => x.ToLocal()).ToList()); }
public ICollection <Film> GetAllFilmService() { return(filmRepository.GetAll()); }
public ICollection <Film> GetAll() { return(repository.GetAll()); }
public HomeController(Context context) { Repository = new FilmRepository(context); Handlers = new Dictionary <SearchCriterionType, Func <string, IEnumerable <Film> > >() { { SearchCriterionType.SearchByName, Repository.GetFilmsByName }, { SearchCriterionType.SearchByActorName, Repository.GetFilmsByActorName }, { SearchCriterionType.SearchByGenre, (str) => { Genre genre; return(Enum.TryParse(str, out genre) ? Repository.GetFilmsByGenre(genre) : Repository.GetAll()); } } }; }
private void btnModify_Click(object sender, EventArgs e) { try { var allFilms = filmsRepo.GetAll(); Film filmToedit = filmsRepo.GetBytitle(allFilms, filmListBoxSelected).FirstOrDefault(); //recogemos la pelicula a modificar y vamos comparando si los datos introducidos son distintos a los que tiene. //en ese caso se los asignamos if (filmToedit.Title != txtTitle.Text) { filmToedit.Title = txtTitle.Text; } if (filmToedit.Duration.ToString() != txtDuration.Text) { filmToedit.Duration = int.Parse(txtDuration.Text); } if (filmToedit.IdGenre != getGenre(cmbGenreMod.SelectedItem.ToString())) { filmToedit.IdGenre = getGenre(cmbGenreMod.SelectedItem.ToString()); } if (filmToedit.Year.ToString() != txtYear.Text) { filmToedit.Year = int.Parse(txtYear.Text); } if (pathSelected == true) { filmToedit.Path = filmPath; } if (filmToedit.Description != txtDescription.Text) { filmToedit.Description = txtDescription.Text; } if (photo == true) { filmToedit.PhotoPath = photoPath; } if (!string.IsNullOrEmpty(txtUrl.Text)) { filmToedit.Path = txtUrl.Text; } //comprobamos campos vacios o incorrectos if (string.IsNullOrEmpty(txtTitle.Text) || string.IsNullOrEmpty(txtDuration.Text) || string.IsNullOrEmpty(txtYear.Text) || string.IsNullOrEmpty(txtRate.Text) || getGenre(cmbGenreMod.SelectedItem.ToString()) == -1 || string.IsNullOrEmpty(txtDescription.Text)) { MessageBox.Show("Faltan campos por rellenar", "Error"); } else { //si todo ha ido bien llamamos al metodo para modificar if (filmcontroller.modificarPeli(filmToedit) != true) { MessageBox.Show("Ha ocurrido un error al modificar la pelicula", "Error"); } else { //reiniciamos campos y parametros MessageBox.Show("Película modificada", "Éxito"); txtDuration.Text = ""; txtTitle.Text = ""; txtRate.Text = ""; cmbGenres.Text = "Selecciona"; txtYear.Text = ""; txtDescription.Text = ""; cmbGenreMod.Text = "Selecciona"; cmbGenres.Text = "Selecciona"; txtUrl.Text = ""; lblCorrecto.Visible = false; listBoxPelis.Items.Clear(); imgPeli.Image = null; } } } catch (Exception) { MessageBox.Show("Campos Rellenados incorrectamente", "Error"); } }
public void GetAll_Single_SeedFilm() { var film = _filmRepositorySUT.GetAll().Single(i => i.Id == Seed.GreaseFilm.Id); Assert.Equal(FilmMapper.MapToListModel(Seed.GreaseFilm), film, FilmListModel.IdOriginalNameComparer); }
public List <Film> GetAll() { return(filmRepository.GetAll()); }
public void InitializeFilmsCache() { ApplicationCache <Film> .FillCache(_filmRepository.GetAll().ToList()); }
public List <Film> GetAll() { return(DalInstance.GetAll().Select(f => f.ToLocal()).ToList()); }