diff --git a/tests/Imageflow.Test/Imageflow.Test.csproj b/tests/Imageflow.Test/Imageflow.Test.csproj index 843dbb8..cd2baf4 100644 --- a/tests/Imageflow.Test/Imageflow.Test.csproj +++ b/tests/Imageflow.Test/Imageflow.Test.csproj @@ -12,6 +12,9 @@ true + + $(NoWarn);CA1510 + diff --git a/tests/Imageflow.Test/TestApi.cs b/tests/Imageflow.Test/TestApi.cs index a4be8e4..9a3976a 100644 --- a/tests/Imageflow.Test/TestApi.cs +++ b/tests/Imageflow.Test/TestApi.cs @@ -137,6 +137,28 @@ public async Task TestAllJob() Assert.True(r.First.TryGetBytes().HasValue); } } + + [Fact] + public async Task TestCreateCanvasBgra32() + { + using var b = new ImageJob(); + var r = await b.CreateCanvasBgra32(10, 20, AnyColor.Black).Encode(new BytesDestination(), new WebPLosslessEncoder()).Finish().InProcessAsync(); + + Assert.Equal(10, r.First!.Width); + Assert.Equal(20, r.First.Height); + Assert.True(r.First.TryGetBytes().HasValue); + } + [Fact] + public async Task TestCreateCanvasBgr32() + { + using var b = new ImageJob(); + var r = await b.CreateCanvasBgr32(10, 20, AnyColor.Black).Encode(new BytesDestination(), new WebPLosslessEncoder()).Finish().InProcessAsync(); + + Assert.Equal(10, r.First!.Width); + Assert.Equal(20, r.First.Height); + Assert.True(r.First.TryGetBytes().HasValue); + } + [Fact] public async Task TestConstraints() {