public void ParseRecentTracks_Parses_NowPlaying()
        {
            var xelement = XElement.Load(testFilePath + "lastfmRecentTracksResponseNowPlaying.xml");

              var result = new UserRecentTracksResponseParser().Parse(xelement);
              var recentTrack = result.Items.ToList().First() as LastfmUserRecentTrack;

              Assert.That(recentTrack.IsNowPlaying, Is.True);
        }
        public void Parse_TrackInfo()
        {
            var xelement = XElement.Load(testFilePath + "lastfmUserRecenttracksResponse.xml");

              var result = new UserRecentTracksResponseParser().Parse(xelement);
              var recentTrack = result.Items.First() as LastfmUserRecentTrack;

              Assert.That(recentTrack.IsNowPlaying, Is.False);
              Assert.That(recentTrack.Name, Is.EqualTo("Sophisticated Lady"));
              Assert.That(recentTrack.Album, Is.EqualTo("Thelonious Monk Plays Duke Ellington"));
              Assert.That(recentTrack.ExtraLargeImageLocation, Is.EqualTo("http://userserve-ak.last.fm/serve/300x300/94649493.png"));
              Assert.That(recentTrack.LargeImageLocation, Is.EqualTo("http://userserve-ak.last.fm/serve/126/94649493.png"));
              Assert.That(recentTrack.MediumImageLocation, Is.EqualTo("http://userserve-ak.last.fm/serve/64s/94649493.png"));
              Assert.That(recentTrack.SmallImageLocation, Is.EqualTo("http://userserve-ak.last.fm/serve/34s/94649493.png"));
              Assert.That(recentTrack.LastPlayed, Is.EqualTo(new DateTime(2014, 4, 12, 2, 36, 0)));
        }
        public void Parse_Removes_Whitespace_from_Artwork_Location_URLs()
        {
            var xelement = XElement.Load(testFilePath + "lastfmUserRecenttracksResponse.xml");

              var result = new UserRecentTracksResponseParser().Parse(xelement);
              var recentTrack = result.Items.First();

              Assert.That(recentTrack.ExtraLargeImageLocation, Is.Not.StringMatching("^\\s+"));
              Assert.That(recentTrack.ExtraLargeImageLocation, Is.Not.StringMatching("\\s+$"));
              Assert.That(recentTrack.LargeImageLocation, Is.Not.StringMatching("^\\s+"));
              Assert.That(recentTrack.LargeImageLocation, Is.Not.StringMatching("\\s+$"));
              Assert.That(recentTrack.MediumImageLocation, Is.Not.StringMatching("^\\s+"));
              Assert.That(recentTrack.MediumImageLocation, Is.Not.StringMatching("\\s+$"));
              Assert.That(recentTrack.SmallImageLocation, Is.Not.StringMatching("^\\s+"));
              Assert.That(recentTrack.SmallImageLocation, Is.Not.StringMatching("\\s+$"));
        }