Beispiel #1
0
        public void WhenASingleFilmIsAddedThenTheFilmsTitleIsPersistedInTheDatabase(string expectedTitle)
        {
            _repository.Add(new Film(expectedTitle, 1994));

            var actualTitle = SqlHelper.GetFirstRowsFilmName();

            Assert.That(actualTitle, Is.EqualTo(expectedTitle));
        }
        private void Sample1_DialogHost_OnDialogClosing(object sender, DialogClosingEventArgs eventargs)
        {
            if (Equals(eventargs.Parameter, true))
            {
                Review review = new Review
                {
                    ReviewText = tbMovieDesc.Text,
                    Rating     = 4
                };
                ReviewRepository reviewRepository = new ReviewRepository();
                reviewRepository.Add(review);
                Film film = new Film
                {
                    ReviewId         = review.Id,
                    Title            = MovieNameTextBox.Text,
                    DateOfProduction = DateTime.Now
                };

                FilmRepository filmRepository = new FilmRepository();
                filmRepository.Add(film);
            }
        }
 internal void Save()
 {
     CurrentFilm = _filmRepository.Add(CurrentFilm);
 }
Beispiel #4
0
        public void WhenAFilmFailsToBeAddedThenTheReturnValueShouldIndicateFailure()
        {
            var result = _repository.Add(new Film("A Film", 1954));

            Assert.That(result, Is.EqualTo(RepositoryResult.Failed));
        }
Beispiel #5
0
 public void Add(Film film)
 {
     repository.Add(film);
     repository.Save();
 }