public void CreateAudioTrackPlaylist_Test_PlaylistType_NewestToOldest()
        {
            BrightcoveAudioTrackPlaylist playlist = new BrightcoveAudioTrackPlaylist
            {
                Name = "Test Audio Playlist",
                ReferenceId = "new-reference-id-10" + RandomString(8),
                ShortDescription = "This is a playlist's short description",
                PlaylistType = PlaylistType.NewestToOldest,
                FilterTags = new[] { "president" }
            };

            long newId = _api.CreateAudioTrackPlaylist(playlist);
            Assert.Greater(newId, 0);
        }
        public void CreateAudioTrackPlaylist_Test_Basic()
        {
            BrightcoveItemCollection<BrightcoveAudioTrack> audioTracks = _api.FindAllAudioTracks(4, 0);
            BrightcoveAudioTrackPlaylist playlist = new BrightcoveAudioTrackPlaylist
            {
                Name = "Test Audio Playlist",
                ReferenceId = "new-reference-id-5" + RandomString(8),
                // Get a list of random audio tracks to add to the playlist.
                AudioTrackIds = audioTracks.Select(x => x.Id).ToList(),
                ShortDescription = "This is a playlist's short description",
                PlaylistType = PlaylistType.Explicit,
                FilterTags = new[] { "president" }
            };

            long newId = _api.CreateAudioTrackPlaylist(playlist);
            BrightcoveAudioTrackPlaylist newPlaylist = _api.FindAudioTrackPlaylistById(newId);

            Assert.AreEqual(playlist.Name, newPlaylist.Name);
            Assert.AreEqual(playlist.ReferenceId, newPlaylist.ReferenceId);
            Assert.AreEqual(playlist.ShortDescription, newPlaylist.ShortDescription);
            Assert.AreEqual(audioTracks.Count, newPlaylist.AudioTrackIds.Count);
            Assert.AreEqual(audioTracks.Count, newPlaylist.AudioTracks.Count);
            Assert.AreEqual(audioTracks.Count, newPlaylist.AudioTracks.Count(o => o != null));
        }
		/// <summary>
		/// Updates a playlist.
		/// </summary>
		/// <param name="playlist">The playlist you'd like to update.</param>
		/// <returns>The updated playlist.</returns>
		public BrightcoveAudioTrackPlaylist UpdateAudioTrackPlaylist(BrightcoveAudioTrackPlaylist playlist)
		{
			BrightcoveParamCollection parms = CreateWriteParamCollection("update_audiotrack_playlist",
																		 methodParams => methodParams.Add("audiotrack_playlist", playlist));
			return RunPost<BrightcoveResultContainer<BrightcoveAudioTrackPlaylist>>(parms).Result;
		}