コード例 #1
0
ファイル: LibraryTest.cs プロジェクト: hur1can3/Espera
            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();
            }