public void GetDummyDataFromMusicBrainz()
        {
            var cd       = DummyData.MuchAgainstEveryonesAdvice;
            var api      = new MusicBrainzApi("http://musicbrainz.org/");
            var coverApi = new CoverArtArchiveApi("http://coverartarchive.org");

            var discIdResponse = api.GetReleasesByDiscId(MusicBrainzDiscIdCalculator.CalculateDiscId(cd.TableOfContents));

            Assert.That(discIdResponse.Json, Is.EqualTo(cd.GetReleaseByDiscIdResponse), discIdResponse.Json.Replace(@"""", @"\"""));

            if (cd.MusicBrainzReleases != null)
            {
                foreach (var release in cd.MusicBrainzReleases)
                {
                    var releaseResponse = api.GetRelease(release.Key);
                    Assert.That(releaseResponse.Json, Is.EqualTo(release.Value), releaseResponse.Json.Replace(@"""", @"\"""));
                }
            }
            if (cd.AlbumArtResponse != null)
            {
                foreach (var art in cd.AlbumArtResponse)
                {
                    var cover = coverApi.GetReleasesByDiscId(art.Key);
                    Assert.That(cover.Json, Is.EqualTo(art.Value), cover.Json);
                }
            }
        }
 public void GenerateDummyData()
 {
     using (var nativeDrive = CdDrive.Create("f"))
     {
         var toc = nativeDrive.ReadTableOfContents().Result;
         foreach (var track in toc.Tracks)
         {
             Console.WriteLine("new Track({0}, {1}, {2}),", track.TrackNumber, track.Offset, track.Sectors);
         }
         Console.WriteLine("MusicBrainzDiscId= " + MusicBrainzDiscIdCalculator.CalculateDiscId(toc));
     }
 }
Exemplo n.º 3
0
 public string TestCalculationOfDiscIdWithCdDb(TableOfContents toc)
 {
     return(MusicBrainzDiscIdCalculator.CalculateDiscId(toc));
 }