示例#1
0
        public void movies_added_should_ignore_duplicates()
        {
            Mocker.GetMock <IBuildFileNames>()
            .Setup(s => s.GetMovieFolder(It.IsAny <Movie>(), null))
            .Returns((Movie m, NamingConfig n) => m.Title);

            fakeMovies[2].TmdbId = fakeMovies[0].TmdbId;

            var movies = Subject.AddMovies(fakeMovies);

            Mocker.GetMock <IMovieRepository>().Verify(v => v.InsertMany(It.Is <List <Movie> >(l => l.Count == 2)));
        }
示例#2
0
        public void movies_added_event_should_have_proper_path()
        {
            Mocker.GetMock <IBuildFileNames>()
            .Setup(s => s.GetMovieFolder(It.IsAny <Movie>(), null))
            .Returns((Movie m, NamingConfig n) => m.Title);

            var movies = Subject.AddMovies(fakeMovies);

            foreach (Movie movie in movies)
            {
                movie.Path.Should().NotBeNullOrEmpty();
            }

            //Subject.GetAllMovies().Should().HaveCount(3);
        }