Ejemplo n.º 1
0
 public CardDetailController(ICardDetailRepository repository,
                             IVideoCommentRepository vcRepository,
                             IVideoCommentReplyRepository vcrRepository,
                             IVideoPostLikeRepository vplRepository,
                             IVideoCommentLikeRepository vclRepository,
                             IVideoCommentReplyLikeRepository vcrlRepository,
                             IVideoPostRepository vpRepository,
                             INotificationRepository nRepository,
                             IMinimumCostOfLivingRepository mcolRepository,
                             IMyVideosRepository mvRepository,
                             ICurrencyRatesService currencyRate,
                             IYouTubeService youTube,
                             IClientIPService clientIP,
                             IMessageService email,
                             UserManager <ApplicationUser> userManager)
 {
     _repository     = repository;
     _vcRepository   = vcRepository;
     _vcrRepository  = vcrRepository;
     _vplRepository  = vplRepository;
     _vclRepository  = vclRepository;
     _vcrlRepository = vcrlRepository;
     _vpRepository   = vpRepository;
     _nRepository    = nRepository;
     _mcolRepository = mcolRepository;
     _mvRepository   = mvRepository;
     _currencyRate   = currencyRate;
     _youTube        = youTube;
     _clientIP       = clientIP;
     _email          = email;
     _userManager    = userManager;
 }
        public void Setup()
        {
            var configuration = new Mock <IConfiguration>();

            var apiKeySection = new Mock <IConfigurationSection>();

            apiKeySection.Setup(a => a.Value).Returns("AIzaSyAy_0a0bVHWj60mHEmPIK-lS_Ip0dAmQcE");

            var clientApplicationNameSection = new Mock <IConfigurationSection>();

            clientApplicationNameSection.Setup(a => a.Value).Returns("YouTubeApp");

            var youTubeConfigSection = new Mock <IConfigurationSection>();

            youTubeConfigSection.Setup(a => a.GetSection("APIKEY")).Returns(apiKeySection.Object);
            youTubeConfigSection.Setup(a => a.GetSection("ClientApplicationName")).Returns(clientApplicationNameSection.Object);

            configuration.Setup(a => a.GetSection("YouTubeConfig")).Returns(youTubeConfigSection.Object);

            _youtubeService = new YouTubeService(configuration.Object);

            apiKeySection.Setup(a => a.Value).Returns("CHAVE_ERRADA");
            youTubeConfigSection.Setup(a => a.GetSection("APIKEY")).Returns(apiKeySection.Object);
            configuration.Setup(a => a.GetSection("YouTubeConfig")).Returns(youTubeConfigSection.Object);
            _youtubeClientComChaveErrada = new YouTubeService(configuration.Object);
        }
Ejemplo n.º 3
0
 public RemoteDataSource(IYouTubeService youTubeServiceControl)
 {
     _youTubeServiceControl = youTubeServiceControl;
     _youTubeService        = _youTubeServiceControl.GetService();
     _subscriptionsHolder   = new SubscriptionsHolder(_youTubeServiceControl);
     _youTubeWeb            = new YouTubeWeb();
     _playlists             = new List <IPlaylistList>();
 }
Ejemplo n.º 4
0
 public HomeController(IHomeRepository repository,
                       ICurrencyRatesService currencyRate,
                       IYouTubeService youTube)
 {
     _repository = repository;
     _currencyRate = currencyRate;
     _youTube = youTube;
 }
Ejemplo n.º 5
0
 public ChannelUpdateService(IServiceProvider serviceProvider,
                             IChannelUpdateTaskUnloader channelUpdateTaskUnloader,
                             IYouTubeService youTubeService)
 {
     _serviceProvider           = serviceProvider;
     _channelUpdateTaskUnloader = channelUpdateTaskUnloader;
     _youTubeService            = youTubeService;
 }
Ejemplo n.º 6
0
        public MainWindowViewModel(IYouTubeService youTubeService, IApplicationSettings settings)
        {
            _settings = settings;
            _youTubeService = youTubeService;

            _showDownloadLocation = new Lazy<ICommand>(() => new RelayCommand(obj => this.ShowDownloadLocation()));

            RegisterEventHandlers();
        }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="youtubeService">YouTubeサービス</param>
        /// <param name="webClientService">Webクライエントサービス</param>
        public ClonePlaylistItemsDialogViewModel(IYouTubeService youtubeService, IWebClientService webClientService)
        {
            m_YouTubeService   = youtubeService;
            m_WebClientService = webClientService;

            SearchWord       = new ReactivePropertySlim <string>().AddTo(m_Disposables);
            SearchResultList = new ReactiveCollection <PlaylistViewModel>().AddTo(m_Disposables);
            SelectedItem     = new ReactivePropertySlim <PlaylistViewModel>().AddTo(m_Disposables);
        }
Ejemplo n.º 8
0
 public ChannelCreationService(IServiceProvider serviceProvider,
                               IChannelCreationTaskUnloader channelCreationTaskUnloader,
                               IChannelTrackingStarter channelTrackingStarter,
                               IYouTubeService youTubeService)
 {
     _serviceProvider             = serviceProvider;
     _channelCreationTaskUnloader = channelCreationTaskUnloader;
     _channelTrackingStarter      = channelTrackingStarter;
     _youTubeService = youTubeService;
 }
        public SubscriptionsHolder(IYouTubeService youTubeService)
        {
            if (youTubeService == null)
            {
                throw new ArgumentException("youTubeService");
            }

            _youTubeService = youTubeService;
            _subscriptions  = new Dictionary <string, string>();
        }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        internal PlaylistContentViewViewModel(
            IYouTubeService youTubeService,
            IWebClientService webClientService,
            IPlaylistListViewViewModel playlistListViewViewModel)
        {
            m_YouTubeService            = youTubeService;
            m_WebClientService          = webClientService;
            m_PlaylistListViewViewModel = playlistListViewViewModel;
            playlistListViewViewModel.SelectionChanged += PlaylistListViewViewModel_SelectionChanged;

            Title            = new ReactivePropertySlim <string>().AddTo(m_Disposables);
            Description      = new ReactivePropertySlim <string>().AddTo(m_Disposables);
            PlaylistItemList = new ReactiveCollection <PlaylistItemViewModel>().AddTo(m_Disposables);

            // コマンドの生成
            Playlist = new ReactivePropertySlim <Playlist?>().AddTo(m_Disposables);
            CanAddVideosToPlaylistItemAsync   = new ReactivePropertySlim <bool>().AddTo(m_Disposables);
            CanRemovePlaylistItemAsync        = new ReactivePropertySlim <bool>().AddTo(m_Disposables);
            CanMovePlaylistItemAsync          = new ReactivePropertySlim <bool>().AddTo(m_Disposables);
            CanClonePlaylistItemsFromPlaylist = new ReactivePropertySlim <bool>().AddTo(m_Disposables);
            CanAddOrClonePlaylistItems        = new ReactivePropertySlim <bool>().AddTo(m_Disposables);
            Playlist.Subscribe(v => {
                CanAddVideosToPlaylistItemAsync.Value   = (v != null);
                CanRemovePlaylistItemAsync.Value        = (v != null);
                CanMovePlaylistItemAsync.Value          = (v != null);
                CanClonePlaylistItemsFromPlaylist.Value = (v != null);
                CanAddOrClonePlaylistItems.Value        = (v != null);
            });
            AddVideosToPlaylistItemAsyncCommand = CanAddVideosToPlaylistItemAsync
                                                  .ToReactiveCommand()
                                                  .WithSubscribe(async() => await AddVideosToPlaylistItemAsync())
                                                  .AddTo(m_Disposables);
            RemovePlaylistItemAsyncCommand = CanRemovePlaylistItemAsync
                                             .ToReactiveCommand()
                                             .WithSubscribe(async() => await RemovePlaylistItemAsync())
                                             .AddTo(m_Disposables);
            MovePlaylistItemAsyncCommand = CanMovePlaylistItemAsync
                                           .ToReactiveCommand <IPlaylistListViewItemViewModel>()
                                           .WithSubscribe(async param => await MovePlaylistItemAsync(param))
                                           .AddTo(m_Disposables);
            ClonePlaylistItemsFromPlaylistCommand = CanClonePlaylistItemsFromPlaylist
                                                    .ToReactiveCommand()
                                                    .WithSubscribe(async() => await ClonePlaylistItemsFromPlaylist())
                                                    .AddTo(m_Disposables);
            AddOrClonePlaylistItemsCommand = CanAddOrClonePlaylistItems
                                             .ToReactiveCommand()
                                             .WithSubscribe(async() => await AddOrClonePlaylistItems())
                                             .AddTo(m_Disposables);

            // ダイアログを表示するインタラクションを保持
            ShowAddPlaylistItemDialog         = new Interaction <Unit, AddPlaylistItemDialogViewModel>();
            ShowClonePlaylistItemsDialog      = new Interaction <Unit, ClonePlaylistItemsDialogViewModel>();
            ShowAddOrClonePlaylistItemsDialog = new Interaction <Unit, AddOrClonePlaylistItemsDialogViewModel>();
        }
Ejemplo n.º 11
0
        public void YoutubeToMp4Exception()
        {
            IYouTubeService service = Substitute.For <IYouTubeService>();

            service
            .When(x => x.DownloadYouTubeAsync("", MediaType.MediaCodec.none))
            .Do(x => throw new Exception());

            Action action = () => service.DownloadYouTubeAsync("", MediaType.MediaCodec.none);

            action.ShouldThrow <Exception>();
        }
Ejemplo n.º 12
0
 public NewsController(INewsRepository repository,
                       INewsDetailRepository ndRepository,
                       IYouTubeService youTube,
                       IKotraNewsService kotraNews,
                       IMemoryCache memoryCache)
 {
     _repository   = repository;
     _ndRepository = ndRepository;
     _youTube      = youTube;
     _kotraNews    = kotraNews;
     _memoryCache  = memoryCache;
 }
Ejemplo n.º 13
0
 public TrainingService(
     IConfiguration configuration,
     TrainingRepository trainings,
     TeamMemberRepository members,
     IYouTubeService youTubeService,
     VideoStreamRepository videoStreams)
 {
     idlenessMinutesForNewTraining = configuration.GetValue <int>("IdlenessMinutesForNewTraining");
     this.trainings      = trainings;
     this.members        = members;
     this.youTubeService = youTubeService;
     this.videoStreams   = videoStreams;
 }
Ejemplo n.º 14
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="youTubeService">YouTubeサービス</param>
        /// <param name="webClientService">Webクライエントサービス</param>
        public PlaylistListViewViewModel(IYouTubeService youTubeService, IWebClientService webClientService)
        {
            PlaylistList = new ReactiveCollection <IPlaylistListViewItemViewModel>().AddTo(m_Disposables);
            SelectedItem = new ReactivePropertySlim <PlaylistViewModel>().AddTo(m_Disposables);
            // 選択アイテムが変更されたら選択変更イベントも通知する
            SelectedItem.Subscribe(_ => RaiseSelectionChanged());

            m_YouTubeService   = youTubeService;
            m_WebClientService = webClientService;

            // ダイアログを表示するインタラクションを保持
            ShowAddPlaylistDialog = new Interaction <Unit, AddPlaylistDialogViewModel>();
        }
Ejemplo n.º 15
0
        public YouTubeServiceTests()
        {
            var vidProfile    = new VideoProfile();
            var configuration = new MapperConfiguration(cfg =>
            {
                cfg.AddProfile(vidProfile);
            });

            _mapper     = new Mapper(configuration);
            _youtube    = new YoutubeClient();
            _downloader = new VideoDownloader(_youtube);
            _converter  = new VideoConverter(_mapper);
            _sut        = new YouTubeService(_downloader, _converter);
        }
Ejemplo n.º 16
0
 public AdminController(IAdminRepository repository,
                        IVideoPostRepository vpRepository,
                        ISalaryInfoRepository siRepository,
                        IUploaderRepository uRepository,
                        IYouTubeService youTube,
                        UserManager <ApplicationUser> userManager)
 {
     _repository   = repository;
     _vpRepository = vpRepository;
     _siRepository = siRepository;
     _uRepository  = uRepository;
     _youTube      = youTube;
     _userManager  = userManager;
 }
Ejemplo n.º 17
0
 public ChannelController(UserManager <AppUser> userManager,
                          IChannelRepository channelRepository,
                          IChannelTrackRepository channelTrackRepository,
                          IChannelTaskLoader channelTaskLoader,
                          IRadioHubProxy radioHubProxy,
                          IChannelTrackingStopper channelTrackingStopper,
                          IYouTubeService youTubeService)
 {
     _userManager            = userManager;
     _channelRepository      = channelRepository;
     _channelTrackRepository = channelTrackRepository;
     _channelTaskLoader      = channelTaskLoader;
     _radioHubProxy          = radioHubProxy;
     _channelTrackingStopper = channelTrackingStopper;
     _youTubeService         = youTubeService;
 }
Ejemplo n.º 18
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="youtubeService">YouTubeサービス</param>
        /// <param name="webClientService">Webクライエントサービス</param>
        public AddOrClonePlaylistItemsDialogViewModel(IYouTubeService youtubeService, IWebClientService webClientService)
        {
            m_YouTubeService   = youtubeService;
            m_WebClientService = webClientService;

            SearchWord         = new ReactivePropertySlim <string>().AddTo(m_Disposables);
            SearchResultList   = new ReactiveCollection <ChannelViewModel>().AddTo(m_Disposables);
            TargetPlaylistList = new ReactiveCollection <PlaylistViewModel>().AddTo(m_Disposables);
            TargetVideoList    = new ReactiveCollection <VideoViewModel>().AddTo(m_Disposables);
            SearchResultList   = new ReactiveCollection <ChannelViewModel>().AddTo(m_Disposables);
            SelectedItem       = new ReactivePropertySlim <ChannelViewModel>().AddTo(m_Disposables);
            ActiveTab          = new ReactivePropertySlim <ItemType>().AddTo(m_Disposables);

            // 選択アイテム・タブが変更されたらプレイリスト・動画一覧を更新
            SelectedItem.Subscribe(_ => UpdateActiveTab());
            ActiveTab.Subscribe(_ => UpdateActiveTab());
        }
Ejemplo n.º 19
0
        public void YoutubeToMp4Calls()
        {
            IYouTubeService service   = Substitute.For <IYouTubeService>();
            List <string>   dummyUrls = new List <string>()
            {
                "", ""
            };

            int counter = 0;

            service
            .When(e => e.DownloadYouTubeAsync(Arg.Any <List <string> >(), Arg.Any <MediaType.MediaCodec>()))
            .Do(_ => counter++);

            service.DownloadYouTubeAsync(dummyUrls, MediaType.MediaCodec.mp3);
            service.DownloadYouTubeAsync(dummyUrls, MediaType.MediaCodec.mp3);
            service.DownloadYouTubeAsync(dummyUrls, MediaType.MediaCodec.mp3);
            counter.ShouldBe(3);
        }
        public void Setup()
        {
            _cacheService = new Mock <ICacheService>();

            _youTubeService = new YouTubeService(_cacheService.Object);
        }
Ejemplo n.º 21
0
 public YoutubeSearchController(IYouTubeService youTubeService, ICanalService canalService, IVideoService videoService)
 {
     _youTubeService = youTubeService;
     _canalService   = canalService;
     _videoService   = videoService;
 }
Ejemplo n.º 22
0
 public YouTubeController(IVideoService videoService, IYouTubeService youTubeService)
 {
     _videoService   = videoService;
     _youTubeService = youTubeService;
 }
Ejemplo n.º 23
0
 public VideoController(IYouTubeService yt, IWebHostEnvironment env)
 {
     _env     = env;
     _yt      = yt;
     BasePath = _env.WebRootPath;
 }
Ejemplo n.º 24
0
 public YouTubeController(IYouTubeService service)
 {
     _ytService = service;
 }
 public VideoPlatformMessageHandler(ITwitchService twitchService, IYouTubeService youTubeService)
 {
     _twitchService  = twitchService;
     _youTubeService = youTubeService;
 }
Ejemplo n.º 26
0
 public YouTubeController(
     IYouTubeService youtubeService
     )
 {
     _youtubeService = youtubeService;
 }
Ejemplo n.º 27
0
 public TeamMemberController(ITeamMemberService memberService, IYouTubeService youTubeService)
 {
     this.memberService  = memberService;
     this.youTubeService = youTubeService;
 }