public void Check_Response_Contains_Correct_Info_From_Request()
        {
            // Setup
            var validRequest = new List <TvShowRequest>
            {
                new TvShowRequest
                {
                    Drm          = true,
                    EpisodeCount = 3,
                    Title        = "cool show",
                    Slug         = "sluginfo",
                    ImageRequest = new ImageRequest
                    {
                        ShowImage = "imageurl"
                    }
                }
            };

            var tvShowService = new TvShowService();

            // Action
            var tvShowResp = tvShowService.GetFilteredTvShows(validRequest);

            // Assert
            Assert.That(tvShowResp.Count, Is.EqualTo(1));
            Assert.That(tvShowResp.First().Title, Is.EqualTo(validRequest[0].Title));
            Assert.That(tvShowResp.First().Image, Is.EqualTo(validRequest[0].ImageRequest.ShowImage));
            Assert.That(tvShowResp.First().Slug, Is.EqualTo(validRequest[0].Slug));
        }
        public void Check_It_Returns_Empty_List_If_Does_Not_Match_Filter_Critea()
        {
            // Setup

            var noDrmRequest = new TvShowRequest
            {
                Drm          = false,
                EpisodeCount = 3
            };

            var zeroEpisodeCountRequest =
                new TvShowRequest
            {
                Drm          = true,
                EpisodeCount = 0
            };

            var tvShowService = new TvShowService();

            // Action
            var tvShowResp = tvShowService.GetFilteredTvShows(new List <TvShowRequest> {
                noDrmRequest, zeroEpisodeCountRequest
            });

            // Assert
            Assert.That(tvShowResp.Count, Is.EqualTo(0));
        }
 private void ToggleSubscription()
 {
     TvShowSubscriptionChanged(TvShow);
     SubscribeButtonText = GetSubscribeButtonText();
     IsSubscribing       = TvShowService.IsSubscribing(TvShow);
     ArchiveButtonText   = GetArchiveButtonText();
 }
 private void ToggleArchive()
 {
     TvShow.IsArchived = !TvShow.IsArchived;
     TvShowService.UpdateTvShow(TvShow);
     ArchiveButtonText = GetArchiveButtonText();
     TvShowArchiveChanged(TvShow);
 }
示例#5
0
        public ActionResult TvShow()
        {
            var repo       = new EplRepo();
            var tvshows    = repo.GetAllTvShows();
            var viewmodels = new TvShowService().MapToViewModel(tvshows);

            return(View(viewmodels));
        }
        private string GetSubscribeButtonText()
        {
            if (TvShow == null)
            {
                return("");
            }

            return(TvShowService.IsSubscribing(TvShow) ? "Unsubscribe" : "Subscribe");
        }
        public void Check_It_Returns_Empty_Response_List_If_Request_Is_Null()
        {
            // Setup
            var tvShowService = new TvShowService();

            // Action
            var tvShowResp = tvShowService.GetFilteredTvShows(null);

            // Assert
            Assert.That(tvShowResp.Count, Is.EqualTo(0));
        }
        private void TvShowArchiveChanged(TvShow show)
        {
            if (show == null)
            {
                return;
            }

            showDetails.TvShow    = show;
            shows.TvShows         = TvShowService.GetActiveTvShows().ToObservableCollection();
            archivedShows.TvShows = TvShowService.GetArchivedTvShows().ToObservableCollection();
        }
        private void SaveCustomData()
        {
            if (TvShow.CustomName == CustomName && TvShow.Addic7edID == Addic7edID && TvShow.IMDbID == IMDbID)
            {
                return;
            }

            TvShow.CustomName = CustomName;
            TvShow.Addic7edID = Addic7edID;
            TvShow.IMDbID     = IMDbID;
            SaveButtonText    = GetSaveButtonText();

            TvShowService.UpdateTvShow(TvShow);
        }
        private void TvShowSubscriptionChanged(TvShow show)
        {
            if (show == null)
            {
                return;
            }

            if (TvShowService.IsSubscribing(show))
            {
                TvShowService.Unsubscribe(show);
            }
            else
            {
                TvShowService.Subscribe(show);
            }

            showDetails.TvShow    = show;
            shows.TvShows         = TvShowService.GetActiveTvShows().ToObservableCollection();
            archivedShows.TvShows = TvShowService.GetArchivedTvShows().ToObservableCollection();
        }
        public void Check_It_Correctly_Returns_If_Request_Is_Drm_Enabled_And_More_Than_One_Eposide()
        {
            // Setup
            var validRequest = new List <TvShowRequest>
            {
                new TvShowRequest
                {
                    Drm          = true,
                    EpisodeCount = 3,
                    Title        = "cool show",
                }
            };

            var tvShowService = new TvShowService();

            // Action
            var tvShowResp = tvShowService.GetFilteredTvShows(validRequest);

            // Assert
            Assert.That(tvShowResp.Count, Is.EqualTo(1));
            Assert.That(tvShowResp.First().Title, Is.EqualTo(validRequest[0].Title));
        }
示例#12
0
 public ShowAppController(TvShowService showService, TextFileStorage fileStorage)
 {
     _showService = showService;
     _fileStorage = fileStorage;
 }
示例#13
0
 public TvShowCommand(PlexContext context, AppSettings setting) : base(context, setting)
 {
     Name    = "TV Shows";
     Service = new TvShowService(Context);
 }
 public TvshowsController(TvShowService service)
 {
     this.service = service;
 }
示例#15
0
 public void LoadTvShows()
 {
     TvShows = TvShowService.GetTopRatedTvShows(ConfigurationData.NoImageFoundPath).ToObservableCollection();
 }
 public void LoadTvShows()
 {
     TvShows = TvShowService.GetArchivedTvShows().ToObservableCollection();
 }
 private void OnSearchTvShows()
 {
     searchedTvShows.TvShows     = TvShowService.SearchTvShows(TextBoxSearchQuery, ConfigurationData.NoImageFoundPath).ToObservableCollection();
     searchedTvShows.SearchQuery = TextBoxSearchQuery;
     OnNavigation(Navigation.TvShowsSearched);
 }