Example #1
0
        public void InitializeJukeboxTest()
        {
            Mock <ISelectorService> selectorService = new Mock <ISelectorService>();

            selectorService.Setup(service => service.PrepareSelector()).Returns(Enums.EDeviceStatus.Ready);

            var jukeboxPlayer = new PlayerService(selectorService.Object);

            Enums.EDeviceStatus status = jukeboxPlayer.InitializePlayer();

            status.Should().Be(Enums.EDeviceStatus.Ready);
            selectorService.Verify(service => service.PrepareSelector(), Times.AtLeastOnce);
        }
Example #2
0
        public void MediaMaintenanceTest()
        {
            Mock <ISelectorService> selectorService = new Mock <ISelectorService>();

            selectorService.Setup(service => service.PrepareSelector()).Returns(Enums.EDeviceStatus.Ready);

            var jukeboxPlayer = new PlayerService(selectorService.Object);

            jukeboxPlayer.ChangeSelector(selectorService.Object);

            Enums.EDeviceStatus status = jukeboxPlayer.InitializePlayer();
            status.Should().Be(Enums.EDeviceStatus.Ready);
            selectorService.Verify(service => service.PrepareSelector(), Times.AtLeastOnce);

            jukeboxPlayer.Maintenance(new Mock <IAlbum>().Object, 1);

            selectorService.Verify(selector => selector.Maintenance(It.IsAny <IAlbum>(), It.IsAny <int>()), Times.AtLeastOnce);
        }