public void ShouldContainReleaseWith_2_CreditArtists_ForTestXML()
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(_path);

            List<Release> releases = new List<Release>();
            MusicBrainzReleaseParser mbzParser = new MusicBrainzReleaseParser();

            //act
            releases = mbzParser.GetReleaseInformationFromXmlForArtistId(xmlDoc, _artistId);

            //assert
            List<NameCredit> expectedNameArtists = new List<NameCredit>();
            expectedNameArtists.Add(new NameCredit { Id = "a015074b-e109-412d-9f7b-170b80a0ebbd", Name = "Dharohar Project" });
            expectedNameArtists.Add(new NameCredit { Id = "cd9713d6-6e5f-4143-9412-4d12b7bd47f2", Name = "Laura Marling" });

            List<NameCredit> actualNameArtists = new List<NameCredit>();

            foreach (var creditArtist in releases[0].NameCredits)
            {
                NameCredit nameCredit = new NameCredit { Id = creditArtist.Id, Name = creditArtist.Name };
                actualNameArtists.Add(nameCredit);
            }

            bool test =expectedNameArtists[0].Id == actualNameArtists[0].Id && expectedNameArtists[1].Id == actualNameArtists[1].Id
                    && expectedNameArtists[0].Name == actualNameArtists[0].Name && expectedNameArtists[1].Name == actualNameArtists[1].Name
                    && expectedNameArtists.Count == actualNameArtists.Count;

            Assert.AreEqual(true, test);
        }
        public void ShouldContainReleaseWith_releaseId_title_status_label_NoTracks_ForTestXML()
        {
            //arange
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(_path);

            List<Release> releases = new List<Release>();
            MusicBrainzReleaseParser mbzParser = new MusicBrainzReleaseParser();

            //act
            releases = mbzParser.GetReleaseInformationFromXmlForArtistId(xmlDoc, _artistId);

            //assert
            Release expectedRelease = new Release();
            expectedRelease.Title = "Dharohar Project, Laura Marling and Mumford & Sons";
            expectedRelease.Status = "Official";
            expectedRelease.ReleaseId = "4cf8c4b7-2471-46cd-8865-f2a744f26e8d";
            expectedRelease.Label = "Glassnote Records";
            expectedRelease.NumberOfTracks = 4;

            // too tired to implement IComprarer -> just bruteforced

            Release actualRelese = new Release();
            actualRelese = releases[0];

            bool areValuesEqual =
                expectedRelease.Title == actualRelese.Title && expectedRelease.Status == actualRelese.Status
                && expectedRelease.ReleaseId == actualRelese.ReleaseId && expectedRelease.Label == actualRelese.Label
                && expectedRelease.NumberOfTracks == actualRelese.NumberOfTracks;

            Assert.AreEqual(true, areValuesEqual);
        }
        public void ShouldContainOneReleaseForTestXML()
        {
            //arange
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(_path);

            List<Release> releases = new List<Release>();
            MusicBrainzReleaseParser mbzParser = new MusicBrainzReleaseParser();

            //act
            releases =  mbzParser.GetReleaseInformationFromXmlForArtistId(xmlDoc, _artistId);

            //assert
            int expectedNoReleases = 1;
            Assert.AreEqual(expectedNoReleases, releases.Count);
        }
        public List<Release> GetReleasesByArtistId(string artistId)
        {
            string url = "http://musicbrainz.org/ws/2/release/?query=arid:" + artistId + "&limit=10";

            XmlDocument xmlResponse = new XmlDocument();
            xmlResponse = _releseProxy.GetXmlResponse(url);

            MusicBrainzReleaseParser releaseParser = new MusicBrainzReleaseParser();

            if (!releaseParser.DoesXmlResponseContainReleases(xmlResponse))
            {
                throw new ArgumentException("artist_id is not in musicbrainz.org repository");
            }

            List<Release> releases = new List<Release>();
            releases = releaseParser.GetReleaseInformationFromXmlForArtistId(xmlResponse, artistId);

            return releases;
        }