Exemplo n.º 1
0
        private Video CreateVideo()
        {
            var dto     = CreateVideoUtil.GetNewVideoDetails(testLibrary.LibraryId, -1, -1);
            var videoId = videoRepository.CreateVideo(dto);

            return(videoRepository.GetVideo(videoId).Result);
        }
        private Video CreateAndRetrieveVideo(long libraryId, long seriesId)
        {
            var dto     = CreateVideoUtil.GetNewVideoDetails(libraryId, -1, seriesId);
            var videoId = videoRepository.CreateVideo(dto);

            return(videoRepository.GetVideo(videoId).Result);
        }
Exemplo n.º 3
0
        public void GetNumberOfFinishedSeriesInLibrary_WithFinishedSeries()
        {
            for (int i = 0; i < 1; ++i)
            {
                var series         = CreateAndRetrieveSeries();
                var createVideoDto = CreateVideoUtil.GetNewVideoDetails(testLibrary.LibraryId, -1, series.SeriesId);
                var videoId        = videoRepository.CreateVideo(createVideoDto);
                var video          = videoRepository.GetVideo(videoId).Result;
                video.TimesWatched = 1;
                videoRepository.UpdateVideo(video).ConfigureAwait(false);
            }

            var librariesCount = repository.GetNumberOfFinishedSeriesInLibrary(testLibrary.LibraryId).Result;

            Assert.AreEqual(1, librariesCount);
        }
Exemplo n.º 4
0
        public ActionResult View(int id)
        {
            var model = new ViewVideoViewModel();

            if (id != 0)
            {
                _videoRepo.AddView(id);
                model.Video = _videoRepo.GetVideo(id, true);

                SqlCommand command = new SqlCommand()
                {
                    CommandText = "spGetUserVideos",
                    CommandType = CommandType.StoredProcedure
                };
                command.Parameters.AddWithValue("@id", model.Video.User.UserID);
                model.VideoList = _videoRepo.GetVideoList(command);
            }

            return(View(model));
        }
Exemplo n.º 5
0
        private Video CreateAndRetrieveVideo(CreateVideoDto dto)
        {
            var id = repository.CreateVideo(dto);

            return(repository.GetVideo(id).Result);
        }