コード例 #1
0
 private void SetupSettings(int movie, int tv, int album)
 {
     SettingsMock.Setup(x => x.GetSettings())
     .Returns(new PlexRequestSettings {
         MovieWeeklyRequestLimit = movie, TvWeeklyRequestLimit = tv, AlbumWeeklyRequestLimit = album
     });
 }
コード例 #2
0
        public void GetPlexTvShowsTests()
        {
            var cachedTv = F.Build <PlexSearch>().Without(x => x.Directory).CreateMany().ToList();

            cachedTv.Add(new PlexSearch
            {
                Directory = new List <Directory1>
                {
                    new Directory1 {
                        Type = "show", Title = "title1", Year = "2016", ProviderId = "1212", Seasons = new List <Directory1>()
                    }
                }
            });
            SettingsMock.Setup(x => x.GetSettings()).Returns(F.Create <PlexSettings>());
            CacheMock.Setup(x => x.Get <List <PlexSearch> >(CacheKeys.PlexLibaries)).Returns(cachedTv);
            var movies = Checker.GetPlexTvShows();

            Assert.That(movies.Any(x => x.ProviderId == "1212"));
        }
コード例 #3
0
        public void GetPlexMoviesTests()
        {
            var cachedMovies = F.Build <PlexSearch>().Without(x => x.Directory).CreateMany().ToList();

            cachedMovies.Add(new PlexSearch
            {
                Video = new List <Video>
                {
                    new Video {
                        Type = "movie", Title = "title1", Year = "2016", ProviderId = "1212"
                    }
                }
            });
            CacheMock.Setup(x => x.Get <List <PlexSearch> >(CacheKeys.PlexLibaries)).Returns(cachedMovies);
            SettingsMock.Setup(x => x.GetSettings()).Returns(F.Create <PlexSettings>());
            var movies = Checker.GetPlexMovies();

            Assert.That(movies.Any(x => x.ProviderId == "1212"));
        }