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();
 }
Example #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>();
        }
        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));
        }
        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);
        }
Example #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);
     }
 }
Example #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);
 }
Example #8
0
 public SpotifyService(IYouTubeGoogleService youTubeGoogleService, ISpotifyWebApi spotifyWebApi)
 {
     m_youTubeGoogleService = youTubeGoogleService;
     m_spotifyWebApi        = spotifyWebApi;
 }
Example #9
0
 /// <summary>Starts the continuous update.</summary>
 public void StartContinuousUpdate()
 {
     this.api = this.container.Resolve <ISpotifyWebApi>();
     this.UpdateContinuously();
 }
 public Data(Token token, ISpotifyWebApi api)
 {
     this.Token = token;
     this.Api   = api;
 }