Exemplo n.º 1
0
        public void Clone_ShouldReturnObjectClone()
        {
            ExecuteInMainThread(() =>
            {
                var getItemResult = _playlist.GetItem(0);
                this.AreEqual(ActionResultType.OK, getItemResult.ResultType, "Unable to get item from playlist");

                this.NotNull(getItemResult.Result);
                this.NotNull(getItemResult.Result.FileInfo);

                var original = getItemResult.Result.FileInfo;
                var clone    = original.Clone();

                this.NotNull(clone);

                this.AreEqual(original.Album, clone.Album, fieldName: "Album");
                this.AreEqual(original.AlbumArtist, clone.AlbumArtist, fieldName: "AlbumArtist");
                this.AreEqual(original.AlbumGain, clone.AlbumGain, fieldName: "AlbumGain");
                this.AreEqual(original.AlbumPeak, clone.AlbumPeak, fieldName: "AlbumPeak");
                this.AreEqual(original.Artist, clone.Artist, fieldName: "Artist");
                this.AreEqual(original.BitRate, clone.BitRate, fieldName: "BitRate");
                this.AreEqual(original.BitDepth, clone.BitDepth, fieldName: "BitDepth");
                this.AreEqual(original.BPM, clone.BPM, fieldName: "BPM");
                this.AreEqual(original.Channels, clone.Channels, fieldName: "Channels");
                this.AreEqual(original.Codec, clone.Codec, fieldName: "Codec");
                this.AreEqual(original.Comment, clone.Comment, fieldName: "Comment");
                this.AreEqual(original.Composer, clone.Composer, fieldName: "Composer");
                this.AreEqual(original.CopyRight, clone.CopyRight, fieldName: "CopyRight");
                this.AreEqual(original.CUESheet, clone.CUESheet, fieldName: "CUESheet");
                this.AreEqual(original.Date, clone.Date, fieldName: "Date");
                this.AreEqual(original.DiskNumber, clone.DiskNumber, fieldName: "DiskNumber");
                this.AreEqual(original.DiskTotal, clone.DiskTotal, fieldName: "DiskTotal");
                this.AreEqual(original.Duration, clone.Duration, fieldName: "Duration");
                this.AreEqual(original.FileName, clone.FileName, fieldName: "FileName");
                this.AreEqual(original.FileSize, clone.FileSize, fieldName: "FileSize");
                this.AreEqual(original.Genre, clone.Genre, fieldName: "Genre");
                this.AreEqual(original.Lyrics, clone.Lyrics, fieldName: "Lyrics");
                this.AreEqual(original.Publisher, clone.Publisher, fieldName: "Publisher");
                this.AreEqual(original.SampleRate, clone.SampleRate, fieldName: "SampleRate");
                this.AreEqual(original.Title, clone.Title, fieldName: "Title");
                this.AreEqual(original.TrackGain, clone.TrackGain, fieldName: "TrackGain");
                this.AreEqual(original.TrackNumber, clone.TrackNumber, fieldName: "TrackNumber");
                this.AreEqual(original.TrackPeak, clone.TrackPeak, fieldName: "TrackPeak");
                this.AreEqual(original.TrackTotal, clone.TrackTotal, fieldName: "TrackTotal");
                this.AreEqual(original.URL, clone.URL, fieldName: "URL");
                this.AreEqual(original.AddedDate, clone.AddedDate, fieldName: "AddedDate");
                this.AreEqual(original.LastPlayedDate, clone.LastPlayedDate, fieldName: "LastPlayedDate");
                this.AreEqual(original.Conductor, clone.Conductor, fieldName: "Conductor");
                this.AreEqual(original.Mood, clone.Mood, fieldName: "Mood");
                this.AreEqual(original.Catalog, clone.Catalog, fieldName: "Catalog");
                this.AreEqual(original.Isrc, clone.Isrc, fieldName: "Isrc");
                this.AreEqual(original.Lyricist, clone.Lyricist, fieldName: "Lyricist");
                this.AreEqual(original.EncodedBy, clone.EncodedBy, fieldName: "EncodedBy");
                this.AreEqual(original.Rating, clone.Rating, fieldName: "Rating");
            });
        }
Exemplo n.º 2
0
        public void RefreshTracks()
        {
            listView1.Items.Clear();
            int count = _playList.GetItemCount();

            for (var i = 0; i < count; i++)
            {
                var item = _playList.GetItem(i);
                if (item.ResultType != ActionResultType.OK)
                {
                    continue;
                }

                listView1.Items.Add(GetTrack(item.Result));
            }
        }
Exemplo n.º 3
0
        public void NoRating_ShouldReturnZero()
        {
            ExecuteInMainThread(() =>
            {
                var getItemResult = _playlist.GetItem(1);
                this.AreEqual(ActionResultType.OK, getItemResult.ResultType, "Unable to get item from playlist");

                this.NotNull(getItemResult.Result);

                this.NotNull(getItemResult.Result.FileInfo);
                var statMark   = getItemResult.Result.FileInfo.StatMark;
                var statRating = getItemResult.Result.FileInfo.StatRating;
                var rating     = getItemResult.Result.FileInfo.Rating;
                this.AreEqual(0, statMark);
                this.AreEqual(0, statRating);
                this.AreEqual(0, rating);
            });
        }
Exemplo n.º 4
0
        public void Delete_ShouldBeOK()
        {
            ExecuteInMainThread(() =>
            {
                var getItemResult = _playlist.GetItem(0);
                this.AreEqual(ActionResultType.OK, getItemResult.ResultType, "Failed. Get playlist item");

                var result = PlaylistQueue.Add(getItemResult.Result, true).ResultType;
                this.AreEqual(ActionResultType.OK, result, "Failed. Add item to PlaylistQueue");

                var oldCount = PlaylistQueue.GetItemCount();

                result = PlaylistQueue.Delete(getItemResult.Result).ResultType;
                this.AreEqual(ActionResultType.OK, result, "Failed. Delete item from PlaylistQueue");

                var count = PlaylistQueue.GetItemCount();
                this.AreEqual(oldCount - 1, count);
            });
        }