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)); } }
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)); } }