|
2 | 2 | // Licensed under the Apache License, Version 2.0. |
3 | 3 |
|
4 | 4 | using Microsoft.Extensions.DependencyInjection; |
| 5 | +using SixLabors.ImageSharp.Web.Caching; |
| 6 | +using SixLabors.ImageSharp.Web.Commands; |
5 | 7 | using SixLabors.ImageSharp.Web.DependencyInjection; |
| 8 | +using SixLabors.ImageSharp.Web.Processors; |
| 9 | +using SixLabors.ImageSharp.Web.Providers; |
6 | 10 | using Xunit; |
7 | 11 |
|
8 | 12 | namespace SixLabors.ImageSharp.Web.Tests.DependencyInjection |
9 | 13 | { |
10 | 14 | public class ServiceRegistrationExtensionsTests |
11 | 15 | { |
| 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 | + |
12 | 32 | [Fact] |
13 | 33 | public void CanAddRemoveImageProviders() |
14 | 34 | { |
|
0 commit comments