Skip to content

Commit

Permalink
Update AddBooruParsers
Browse files Browse the repository at this point in the history
  • Loading branch information
ImoutoChan committed Oct 3, 2023
1 parent b579e0b commit 45fc81c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Imouto.BooruParser.Tests/Loaders/SankakuLoaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public async Task ShouldGetPostByMd5Async()
}

[Fact]
public async Task ShouldGetPostByMd5Async_2a00599e108817e0d9a4eb2e3f353abb()
public async Task ShouldGetPostByMd5Async_dc9da74597ecd47b2848fb4d68fce77a()
{
var loader = _loaderFixture.GetLoaderWithAuth();

Expand Down Expand Up @@ -151,6 +151,17 @@ public async Task ShouldGetPostByMd5Async_2a00599e108817e0d9a4eb2e3f353abb()
post.FileSizeInBytes.Should().Be(22152413);
post.UgoiraFrameDelays.Should().BeEmpty();
}

[Fact]
public async Task ShouldGetPostByMd5Async_d62ed6aebd2b75aa9661795b54a957d7()
{
var loader = _loaderFixture.GetLoaderWithAuth();

var post = await loader.GetPostByMd5Async("d62ed6aebd2b75aa9661795b54a957d7");

post.Should().NotBeNull();
post!.Tags.Should().HaveCount(57);
}

[Fact]
public async Task ShouldContainLinkWithoutAmp()
Expand Down
3 changes: 3 additions & 0 deletions Imouto.BooruParser/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Flurl.Http.Configuration;
using Imouto.BooruParser.Implementations.Danbooru;
using Imouto.BooruParser.Implementations.Gelbooru;
using Imouto.BooruParser.Implementations.Rule34;
using Imouto.BooruParser.Implementations.Sankaku;
using Imouto.BooruParser.Implementations.Yandere;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -22,11 +23,13 @@ public static IServiceCollection AddBooruParsers(this IServiceCollection service
services.AddTransient<IBooruApiLoader, YandereApiLoader>();
services.AddTransient<IBooruApiLoader, SankakuApiLoader>();
services.AddTransient<IBooruApiLoader, GelbooruApiLoader>();
services.AddTransient<IBooruApiLoader, Rule34ApiLoader>();

services.AddTransient<DanbooruApiLoader>();
services.AddTransient<YandereApiLoader>();
services.AddTransient<SankakuApiLoader>();
services.AddTransient<GelbooruApiLoader>();
services.AddTransient<Rule34ApiLoader>();

services.AddTransient<IBooruApiAccessor, DanbooruApiLoader>();
services.AddTransient<IBooruApiAccessor, YandereApiLoader>();
Expand Down

0 comments on commit 45fc81c

Please sign in to comment.