More updates.

This commit is contained in:
2025-06-25 10:40:03 -04:00
parent a82eab0ecb
commit 33e521e8bb
28 changed files with 334 additions and 63 deletions

View File

@@ -31,6 +31,24 @@ public class MangaPipelineTests(TestDbContextFactory factory) : IClassFixture<Te
}
],
Genres = ["Action", "Adventure"],
Contributors =
[
new()
{
Name = "Manga Author",
Role = ContributorRole.Author
},
new()
{
Name = "Manga Author",
Role = ContributorRole.Artist
},
new()
{
Name = "Helper Artist",
Role = ContributorRole.Artist
}
],
Chapters =
[
new()
@@ -50,7 +68,7 @@ public class MangaPipelineTests(TestDbContextFactory factory) : IClassFixture<Te
SourceManga = sourceManga
};
await pipeline.RunMetadataAsync(request);
await pipeline.RunMetadataAsync(request, CancellationToken.None);
context.Mangas.ShouldHaveSingleItem();
context.MangaTitles.Count().ShouldBe(2);
@@ -58,6 +76,15 @@ public class MangaPipelineTests(TestDbContextFactory factory) : IClassFixture<Te
context.MangaTitles.Where(mt => mt.IsPrimary).First().Name.ShouldBe("Fullmetal Alchemist");
context.MangaTitles.Where(mt => mt.IsPrimary).First().Language.ShouldBe(Language.English);
context.Genres.Count().ShouldBe(2);
context.MangaContributors.Count().ShouldBe(3);
context.MangaContributors.ElementAt(0).Contributor.Name.ShouldBe("Manga Author");
context.MangaContributors.ElementAt(0).Role.ShouldBe(ContributorRole.Author);
context.MangaContributors.ElementAt(1).Contributor.Name.ShouldBe("Manga Author");
context.MangaContributors.ElementAt(1).Role.ShouldBe(ContributorRole.Artist);
context.MangaContributors.ElementAt(2).Contributor.Name.ShouldBe("Helper Artist");
context.MangaContributors.ElementAt(2).Role.ShouldBe(ContributorRole.Artist);
context.SourceChapters.ShouldHaveSingleItem();
}
}

View File

@@ -258,10 +258,10 @@ public class MangaDexMetadataTests
sourceManga.Contributors.Length.ShouldBe(2);
sourceManga.Contributors[0].Name.ShouldBe("Norishiro-chan");
sourceManga.Contributors[0].Role.ShouldBe(SourceMangaContributorRole.Author);
sourceManga.Contributors[0].Role.ShouldBe(ContributorRole.Author);
sourceManga.Contributors[1].Name.ShouldBe("Sakana Uozimi");
sourceManga.Contributors[1].Role.ShouldBe(SourceMangaContributorRole.Artist);
sourceManga.Contributors[1].Role.ShouldBe(ContributorRole.Artist);
sourceManga.Chapters.Count.ShouldBe(3);

View File

@@ -1,4 +1,5 @@
using MangaReader.Core.Http;
using MangaReader.Core.Common;
using MangaReader.Core.Http;
using MangaReader.Core.Metadata;
using MangaReader.Core.Sources.MangaNato.Metadata;
using MangaReader.Tests.Utilities;
@@ -37,7 +38,7 @@ public class MangaNatoMetadataTests
SourceMangaContributor[] expectedContributors =
[
new() { Name = "Nagaoka Taichi", Role = SourceMangaContributorRole.Author }
new() { Name = "Nagaoka Taichi", Role = ContributorRole.Author }
];
manga.Contributors.ShouldBeEquivalentTo(expectedContributors);