Ejemplo n.º 1
0
        // Control

        public void SetState(State state)
        {
            if (previousInfo != null && previousInfo.State == state)
            {
                return;
            }

            StopUpdate();
            Task.Run(async() =>
            {
                Result task;
                switch (state)
                {
                case State.Playing:
                    task = await player.PlayAsync();
                    break;

                case State.Paused:
                    task = await player.PauseAsync();
                    break;

                case State.Stoped:
                    task = await player.StopAsync();
                    break;

                default:
                    task = await player.StopAsync();
                    break;
                }
            }).GetAwaiter().GetResult();
            RunUpdate();
        }
        public async void Stop()
        {
            var res = await _mpcHomeCinema.StopAsync();

            Assert.True(res.ResultCode == ResultCode.Ok);
            Assert.Equal(State.Stoped, res.Info.State);
        }