示例#1
0
            public void ThrowsAccessExceptionIfPartyModeAndLockPlaylistSwitchingIsTrue()
            {
                var settings = new CoreSettings
                {
                    LockPlaylist = true
                };

                using (Library library = new LibraryBuilder().WithPlaylist("Playlist 1").WithSettings(settings).Build())
                {
                    Guid token = library.LocalAccessControl.RegisterLocalAccessToken();

                    library.AddPlaylist("Playlist 2", token);

                    library.LocalAccessControl.SetLocalPassword(token, "Password");
                    library.LocalAccessControl.DowngradeLocalAccess(token);

                    Assert.Throws<AccessException>(() => library.SwitchToPlaylist(library.GetPlaylistByName("Playlist 2"), token));
                }
            }