Ejemplo n.º 1
0
        public async Task SetRandomTest()
        {
            var res1 = await Tracklist.GetRandom();

            Assert.True(res1.Succeeded);

            var res2 = await Tracklist.SetRandom(!res1.Result);

            Assert.True(res2);

            var res3 = await Tracklist.GetRandom();

            Assert.True(res3.Succeeded);
            Assert.True(res1.Result != res3.Result);
        }
Ejemplo n.º 2
0
        public async Task OptionsChangedTest()
        {
            if (Mopidy.Settings.ConnectionType != Mopidy.Settings.Connection.WebSocket)
            {
                return;
            }

            var res1 = await Tracklist.GetConsume();

            Assert.True(res1.Succeeded);

            var res2 = await Tracklist.GetRandom();

            Assert.True(res2.Succeeded);

            var res3 = await Tracklist.GetRepeat();

            Assert.True(res3.Succeeded);

            var res4 = await Tracklist.GetSingle();

            Assert.True(res4.Succeeded);

            var recieved = false;

            CoreListener.OptionsChanged += (sender, ev) =>
            {
                recieved = true;
            };

            var res12 = await Tracklist.SetConsume(!res1.Result);

            Assert.True(res12);
            await Task.Delay(WaitMsec);

            Assert.True(recieved);

            recieved = false;
            var res22 = await Tracklist.SetRandom(!res2.Result);

            Assert.True(res22);
            await Task.Delay(WaitMsec);

            Assert.True(recieved);

            recieved = false;
            var res32 = await Tracklist.SetRepeat(!res3.Result);

            Assert.True(res32);
            await Task.Delay(WaitMsec);

            Assert.True(recieved);

            recieved = false;
            var res42 = await Tracklist.SetSingle(!res4.Result);

            Assert.True(res42);
            await Task.Delay(WaitMsec);

            Assert.True(recieved);
        }