|
|
@ -8,9 +8,14 @@ using System.Linq; |
|
|
using SixLabors.ImageSharp.Formats; |
|
|
using SixLabors.ImageSharp.Formats; |
|
|
using SixLabors.ImageSharp.IO; |
|
|
using SixLabors.ImageSharp.IO; |
|
|
using SixLabors.ImageSharp.PixelFormats; |
|
|
using SixLabors.ImageSharp.PixelFormats; |
|
|
|
|
|
using SixLabors.ImageSharp.Formats.Png; |
|
|
|
|
|
using SixLabors.ImageSharp.Formats.Bmp; |
|
|
|
|
|
using SixLabors.ImageSharp.Formats.Jpeg; |
|
|
|
|
|
using SixLabors.ImageSharp.Formats.Gif; |
|
|
using Moq; |
|
|
using Moq; |
|
|
using Xunit; |
|
|
using Xunit; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace SixLabors.ImageSharp.Tests |
|
|
namespace SixLabors.ImageSharp.Tests |
|
|
{ |
|
|
{ |
|
|
public class ImageFormatManagerTests |
|
|
public class ImageFormatManagerTests |
|
|
@ -27,8 +32,15 @@ namespace SixLabors.ImageSharp.Tests |
|
|
[Fact] |
|
|
[Fact] |
|
|
public void IfAutoloadWellKnownFormatsIsTrueAllFormatsAreLoaded() |
|
|
public void IfAutoloadWellKnownFormatsIsTrueAllFormatsAreLoaded() |
|
|
{ |
|
|
{ |
|
|
Assert.Equal(4, this.DefaultFormatsManager.ImageEncoders.Count()); |
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageEncoders.Select(item => item.Value).OfType<PngEncoder>().Count()); |
|
|
Assert.Equal(4, this.DefaultFormatsManager.ImageDecoders.Count()); |
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageEncoders.Select(item => item.Value).OfType<BmpEncoder>().Count()); |
|
|
|
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageEncoders.Select(item => item.Value).OfType<JpegEncoder>().Count()); |
|
|
|
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageEncoders.Select(item => item.Value).OfType<GifEncoder>().Count()); |
|
|
|
|
|
|
|
|
|
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<PngDecoder>().Count()); |
|
|
|
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<BmpDecoder>().Count()); |
|
|
|
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<JpegDecoder>().Count()); |
|
|
|
|
|
Assert.Equal(1, this.DefaultFormatsManager.ImageDecoders.Select(item => item.Value).OfType<BmpDecoder>().Count()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
|