Ejemplo n.º 1
0
        public void MediaControllerConnectTest()
        {
            bool            connected  = false;
            MediaController controller = MediaController.GetMediaController();

            Assert.IsFalse(controller.IsAvailable);
            controller.LocalMediaAvailable += (s, e) =>
            {
                Assert.IsTrue(controller.IsAvailable);
                controller.Dispose();
                connected = true;
            };
            controller.Connect();
            EnqueueConditional(() => connected);
            EnqueueTestComplete();
        }
Ejemplo n.º 2
0
        public void MediaControllerSetVolumeTest()
        {
            bool            volumeSet  = false;
            MediaController controller = MediaController.GetMediaController();

            Assert.IsFalse(controller.IsAvailable);
            controller.LocalMediaAvailable += (s, e) =>
            {
                Assert.IsTrue(controller.IsAvailable);
                int volume = 5;
                controller.SetVolume(volume, error => CheckError(error, controller));
                volumeSet = true;
            };
            controller.Connect();
            EnqueueConditional(() => volumeSet);
            EnqueueTestComplete();
        }
Ejemplo n.º 3
0
        public void MediaControllerUnmuteTest()
        {
            bool            unmuted    = false;
            MediaController controller = MediaController.GetMediaController();

            Assert.IsFalse(controller.IsAvailable);
            controller.LocalMediaAvailable += (s, e) =>
            {
                Assert.IsTrue(controller.IsAvailable);
                controller.Unmute(error =>
                {
                    CheckError(error, controller);
                    unmuted = true;
                });
            };
            controller.Connect();
            EnqueueConditional(() => unmuted);
            EnqueueTestComplete();
        }
Ejemplo n.º 4
0
        public void MediaControllerGetVolumeTest()
        {
            bool            volumeRetrieved = false;
            MediaController controller      = MediaController.GetMediaController();

            Assert.IsFalse(controller.IsAvailable);
            controller.LocalMediaAvailable += (s, e) =>
            {
                Assert.IsTrue(controller.IsAvailable);
                controller.GetVolume((error, volume) =>
                {
                    Assert.IsTrue(volume > 0);
                    CheckError(error, controller);
                    volumeRetrieved = true;
                });
            };
            controller.Connect();
            EnqueueConditional(() => volumeRetrieved);
            EnqueueTestComplete();
        }