diff --git a/tests/ImageSharp.Tests/Image/ImageTests.ImageLoadTestBase.cs b/tests/ImageSharp.Tests/Image/ImageTests.ImageLoadTestBase.cs index 8c9f0994f..ea1e6e0d7 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.ImageLoadTestBase.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.ImageLoadTestBase.cs @@ -3,7 +3,7 @@ using System; using System.IO; - +using System.Threading; using Moq; using SixLabors.ImageSharp.Formats; @@ -60,7 +60,7 @@ namespace SixLabors.ImageSharp.Tests var detector = new Mock(); detector.Setup(x => x.Identify(It.IsAny(), It.IsAny())).Returns(this.localImageInfoMock.Object); - detector.Setup(x => x.IdentifyAsync(It.IsAny(), It.IsAny(), TODO)).ReturnsAsync(this.localImageInfoMock.Object); + detector.Setup(x => x.IdentifyAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(this.localImageInfoMock.Object); this.localDecoder = detector.As(); this.localMimeTypeDetector = new MockImageFormatDetector(this.localImageFormatMock.Object); diff --git a/tests/ImageSharp.Tests/TestFormat.cs b/tests/ImageSharp.Tests/TestFormat.cs index 4c62c101c..aa986aa8a 100644 --- a/tests/ImageSharp.Tests/TestFormat.cs +++ b/tests/ImageSharp.Tests/TestFormat.cs @@ -220,8 +220,7 @@ namespace SixLabors.ImageSharp.Tests return this.testFormat.Sample(); } - public Task> DecodeAsync(Configuration config, Stream stream, - CancellationToken cancellationToken) + public Task> DecodeAsync(Configuration config, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel => Task.FromResult(this.Decode(config, stream)); @@ -229,8 +228,8 @@ namespace SixLabors.ImageSharp.Tests public Image Decode(Configuration configuration, Stream stream) => this.Decode(configuration, stream); - public async Task DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) => await this.DecodeAsync(configuration, stream, TODO); + public async Task DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) + => await this.DecodeAsync(configuration, stream, cancellationToken); } public class TestEncoder : ImageSharp.Formats.IImageEncoder diff --git a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs index f641c579e..de8278a33 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/MagickReferenceDecoder.cs @@ -47,8 +47,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs } } - public Task> DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) + public Task> DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel => Task.FromResult(this.Decode(configuration, stream)); @@ -84,7 +83,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs public Image Decode(Configuration configuration, Stream stream) => this.Decode(configuration, stream); - public async Task DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) => await this.DecodeAsync(configuration, stream, TODO); + public async Task DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) + => await this.DecodeAsync(configuration, stream, cancellationToken); } } diff --git a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs index 62318bd86..1eb1328ef 100644 --- a/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs +++ b/tests/ImageSharp.Tests/TestUtilities/ReferenceCodecs/SystemDrawingReferenceDecoder.cs @@ -15,8 +15,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs { public static SystemDrawingReferenceDecoder Instance { get; } = new SystemDrawingReferenceDecoder(); - public Task> DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) + public Task> DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel => Task.FromResult(this.Decode(configuration, stream)); @@ -50,8 +49,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs } } - public Task IdentifyAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) + public Task IdentifyAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) => Task.FromResult(this.Identify(configuration, stream)); public IImageInfo Identify(Configuration configuration, Stream stream) @@ -65,7 +63,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs public Image Decode(Configuration configuration, Stream stream) => this.Decode(configuration, stream); - public async Task DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) => await this.DecodeAsync(configuration, stream, TODO); + public async Task DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) + => await this.DecodeAsync(configuration, stream, cancellationToken); } } diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index 979b57a63..129d17f4d 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -372,8 +372,7 @@ namespace SixLabors.ImageSharp.Tests return new Image(42, 42); } - public Task> DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) + public Task> DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel { InvocationCountsAsync[this.callerName]++; @@ -393,8 +392,8 @@ namespace SixLabors.ImageSharp.Tests public Image Decode(Configuration configuration, Stream stream) => this.Decode(configuration, stream); - public async Task DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) => await this.DecodeAsync(configuration, stream, TODO); + public async Task DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) + => await this.DecodeAsync(configuration, stream, cancellationToken); } private class TestDecoderWithParameters : IImageDecoder @@ -428,8 +427,7 @@ namespace SixLabors.ImageSharp.Tests return new Image(42, 42); } - public Task> DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) + public Task> DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel { InvocationCountsAsync[this.callerName]++; @@ -449,8 +447,8 @@ namespace SixLabors.ImageSharp.Tests public Image Decode(Configuration configuration, Stream stream) => this.Decode(configuration, stream); - public async Task DecodeAsync(Configuration configuration, Stream stream, - CancellationToken cancellationToken) => await this.DecodeAsync(configuration, stream, TODO); + public async Task DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken) + => await this.DecodeAsync(configuration, stream, cancellationToken); } } }