Пример #1
0
 public SpotifyController(ILog logger, ISpotifyLocalApi localApi, ISpotifyWebApi spotifyWebApi, ISpotifyNativeApi spotifyNativeApi)
 {
     _logger           = logger;
     _localApi         = localApi;
     _spotifyWebApi    = spotifyWebApi;
     _spotifyNativeApi = spotifyNativeApi;
 }
 public void Auth()
 {
     // Autenticate _spotifyWebApi
     _authParameters     = getAuthParameters();
     _spotifyWebApiToken = GetISpotifyWebApiToken();
     _spotifyWebApi      = CreatISpotifyWebApi();
 }
Пример #3
0
        /// <summary>Initializes a new instance of the <see cref="PlaylistService" /> class inside the context of the given container.</summary>
        /// <param name="container">The container.</param>
        public PlaylistService(IUnityContainer container)
        {
            this.container       = container;
            this.eventAggregator = container.Resolve <IEventAggregator>();

            this.api   = container.Resolve <ISpotifyWebApi>();
            this.token = container.Resolve <Token>();
        }
Пример #4
0
        public void TestVolumeFailedRequest(ISpotifyController controller, ISpotifyWebApi spotifyWebApi, double resultVolume)
        {
            _spotifyWebApi.SetVolume(0).ThrowsForAnyArgs <ArgumentException>();

            "Given spotify controller".x(() => controller = _spotifyController);
            "and web api api".x(() => spotifyWebApi       = _spotifyWebApi);
            "When i change volume and it fails".x(async() => resultVolume = await controller.SetSpotifyVolume(2));
            "Then the result is Nan".x(() => Assert.Equal(double.NaN, resultVolume));
        }
Пример #5
0
        public SpotifyControllerTest()
        {
            _localApi      = Substitute.For <ISpotifyLocalApi>();
            _spotifyWebApi = Substitute.For <ISpotifyWebApi>();
            _nativeApi     = Substitute.For <ISpotifyNativeApi>();
            _log           = Substitute.For <ILog>();

            _spotifyController = new SpotifyController(_log, _localApi, _spotifyWebApi, _nativeApi);
        }
Пример #6
0
 public CoverService(string cacheRootDirectory,
                     ILog logger, ISpotifyWebApi webApi)
 {
     _cacheDirectory = Path.Combine(cacheRootDirectory, CacheDirName);
     _logger         = logger;
     _webApi         = webApi;
     if (!Directory.Exists(_cacheDirectory))
     {
         Directory.CreateDirectory(_cacheDirectory);
     }
 }
Пример #7
0
 /// <summary>
 /// The base test class.
 /// </summary>
 public TestBase(TestData testData, ITestOutputHelper output)
 {
     this.TestData = testData;
     this.Output   = output;
     this.Api      = new SpotifyWebApi(this.TestData.ClientCredentialsToken);
 }
Пример #8
0
 public SpotifyService(IYouTubeGoogleService youTubeGoogleService, ISpotifyWebApi spotifyWebApi)
 {
     m_youTubeGoogleService = youTubeGoogleService;
     m_spotifyWebApi        = spotifyWebApi;
 }
Пример #9
0
 /// <summary>Starts the continuous update.</summary>
 public void StartContinuousUpdate()
 {
     this.api = this.container.Resolve <ISpotifyWebApi>();
     this.UpdateContinuously();
 }
Пример #10
0
 public Data(Token token, ISpotifyWebApi api)
 {
     this.Token = token;
     this.Api   = api;
 }