public async Task HandleItemSelection_ItemIsASongOrVideo_ShouldTryToNavigateToThePlaybackViewModel(SubsonicModelTypeEnum type)
        {
            MockNavigationService.NavigateToViewModelCalls.Clear();
            MockLoadModel();

            await Subject.HandleItemSelection(new MockSubsonicModel { Type = type });

            MockNavigationService.NavigateToViewModelCalls.Count.Should().Be(1);
            MockNavigationService.NavigateToViewModelCalls.First().Key.Should().Be <PlaybackViewModel>();
        }
        public async Task HandleItemSelection_ModelTypeIsSongOrVideo_ShouldTryToPublishAnAddItemMessageWithTheObtainedPlaylistItemAndStartPlayingTrue(SubsonicModelTypeEnum type)
        {
            MockEventAggregator.Messages.Clear();
            var playlistItem = new PlaylistItem();

            MockLoadModel(() => playlistItem);

            await Subject.HandleItemSelection(new MockSubsonicModel { Type = type });

            MockEventAggregator.PublishCallCount.Should().Be(1);
            MockEventAggregator.Messages[0].Should().BeOfType <AddItemsMessage>();
            ((AddItemsMessage)MockEventAggregator.Messages[0]).Queue.Count.Should().Be(1);
            ((AddItemsMessage)MockEventAggregator.Messages[0]).Queue[0].Should().Be(playlistItem);
            ((AddItemsMessage)MockEventAggregator.Messages[0]).StartPlaying.Should().BeTrue();
        }
 public GenericMediaModel(SubsonicModelTypeEnum type)
 {
     _type = type;
 }
        public async Task HandleItemSelection_ModelTypeIsSongOrVideo_ShouldTryToLoadThePlaylistItemForTheGivenItem(SubsonicModelTypeEnum type)
        {
            var callCount = 0;

            MockLoadModel(() =>
            {
                callCount++;
                return(new PlaylistItem());
            });

            await Subject.HandleItemSelection(new MockSubsonicModel { Type = type });

            callCount.Should().Be(1);
        }
 public GenericMediaModel(SubsonicModelTypeEnum type)
 {
     _type = type;
 }