Skip to content

Commit 54a57f3

Browse files
Update ServiceRegistrationExtensionsTests.cs
1 parent 042904d commit 54a57f3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/ImageSharp.Web.Tests/DependencyInjection/ServiceRegistrationExtensionsTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,33 @@
22
// Licensed under the Apache License, Version 2.0.
33

44
using Microsoft.Extensions.DependencyInjection;
5+
using SixLabors.ImageSharp.Web.Caching;
6+
using SixLabors.ImageSharp.Web.Commands;
57
using SixLabors.ImageSharp.Web.DependencyInjection;
8+
using SixLabors.ImageSharp.Web.Processors;
9+
using SixLabors.ImageSharp.Web.Providers;
610
using Xunit;
711

812
namespace SixLabors.ImageSharp.Web.Tests.DependencyInjection
913
{
1014
public class ServiceRegistrationExtensionsTests
1115
{
16+
[Fact]
17+
public void DefaultServicesAreRegistered()
18+
{
19+
var services = new ServiceCollection();
20+
services.AddImageSharp();
21+
22+
Assert.Contains(services, x => x.ServiceType == typeof(FormatUtilities));
23+
Assert.Contains(services, x => x.ServiceType == typeof(IRequestParser) && x.ImplementationType == typeof(QueryCollectionRequestParser));
24+
Assert.Contains(services, x => x.ServiceType == typeof(IImageCache) && x.ImplementationType == typeof(PhysicalFileSystemCache));
25+
Assert.Contains(services, x => x.ServiceType == typeof(ICacheHash) && x.ImplementationType == typeof(CacheHash));
26+
Assert.Contains(services, x => x.ServiceType == typeof(IImageProvider) && x.ImplementationType == typeof(PhysicalFileSystemProvider));
27+
Assert.Contains(services, x => x.ServiceType == typeof(IImageWebProcessor) && x.ImplementationType == typeof(ResizeWebProcessor));
28+
Assert.Contains(services, x => x.ServiceType == typeof(IImageWebProcessor) && x.ImplementationType == typeof(FormatWebProcessor));
29+
Assert.Contains(services, x => x.ServiceType == typeof(IImageWebProcessor) && x.ImplementationType == typeof(BackgroundColorWebProcessor));
30+
}
31+
1232
[Fact]
1333
public void CanAddRemoveImageProviders()
1434
{

0 commit comments

Comments
 (0)