Example #1
0
            public void ThrowsInvalidOperationExceptionIfAccessTokenIsNotGuestToken()
            {
                var settings = new CoreSettings { EnableGuestSystem = false };

                using (Library library = new LibraryBuilder().WithSettings(settings).WithPlaylist().Build())
                {
                    Guid accessToken = library.LocalAccessControl.RegisterLocalAccessToken();

                    Assert.Throws<InvalidOperationException>(() => library.AddGuestSongToPlaylist(Helpers.SetupSongMock(), accessToken));
                }
            }
Example #2
0
            public void ThrowsArgumentNullExceptionIfSongIsNull()
            {
                using (Library library = new LibraryBuilder().WithPlaylist().Build())
                {
                    Guid accessToken = library.LocalAccessControl.RegisterLocalAccessToken();
                    library.LocalAccessControl.SetLocalPassword(accessToken, "Password");
                    library.LocalAccessControl.DowngradeLocalAccess(accessToken);

                    Assert.Throws<ArgumentNullException>(() => library.AddGuestSongToPlaylist(null, accessToken));
                }
            }