NowPlaying() public method

public NowPlaying ( ) : IObservable
return IObservable
        public void FetchNowPlayingIntegrationTest()
        {
            var kernel = new MoqMockingKernel();
            var client = new RestClient(IntegrationTestUrl.Current);

            client.AddDefaultHeader("Authorization", IntegrationTestUrl.Token);
            kernel.Bind<IBlobCache>().To<TestBlobCache>();

            var api = new PlayApi(client, kernel.Get<IBlobCache>());

            var result = api.NowPlaying()
                .Timeout(TimeSpan.FromSeconds(9.0), RxApp.TaskpoolScheduler)
                .First();

            this.Log().Info(result.ToString());
            result.id.Should().NotBeNullOrEmpty();
        }
        public IObservable<Unit> ConnectToPlay(string baseUrl, string token)
        {
            var client = new RestClient(baseUrl);
            client.AddDefaultHeader("Authorization", token);

            var api = new PlayApi(client, null);
            return api.NowPlaying().Select(_ => Unit.Default);
        }
Beispiel #3
0
        public IObservable<Unit> ConnectToPlay(string baseUrl, string token)
        {
            var client = new HttpClient() {BaseAddress = new Uri(baseUrl)};

            var api = new PlayApi(client, (m,p) => {
                var ret = new HttpRequestMessage(m, p);
                ret.Headers.Add("Authorization", token);
                return ret;
            });

            return api.NowPlaying().Select(_ => Unit.Default);
        }