Exemple #1
0
            public async Task CallsAudioPlayerPlay()
            {
                var audioPlayerCallback = Substitute.For<IMediaPlayerCallback>();

                using (Library library = new LibraryBuilder().WithPlaylist().WithAudioPlayer(audioPlayerCallback).Build())
                {
                    Guid token = library.LocalAccessControl.RegisterLocalAccessToken();

                    Song song = Helpers.SetupSongMock();

                    library.AddSongToPlaylist(song);

                    await library.PlaySongAsync(0, token);

                    await library.ContinueSongAsync(token);
                }

                audioPlayerCallback.Received(2).PlayAsync();
            }