From 7b1399f5f8c0c2500c921c1323679eb6bdd92738 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Sat, 20 Jun 2020 19:02:07 +0200 Subject: [PATCH] DataCanBeCreatedFromManagedStream --- cake/UtilsManaged.cake | 2 +- tests/Tests/SKDataTest.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cake/UtilsManaged.cake b/cake/UtilsManaged.cake index 60cd63a9..3668a6ea 100644 --- a/cake/UtilsManaged.cake +++ b/cake/UtilsManaged.cake @@ -25,7 +25,7 @@ void RunTests(FilePath testAssembly, bool is32) Parallelism = ParallelismOption.All, OutputDirectory = dir, WorkingDirectory = dir, - ArgumentCustomization = args => args.Append("-verbose -method \"SkiaSharp.Tests.SKDataTest.DataCanBeCreatedFromStream\""), + ArgumentCustomization = args => args.Append("-verbose -method \"SkiaSharp.Tests.SKDataTest.DataCanBeCreatedFromManagedStream\""), }; var traits = CreateTraitsDictionary(UNSUPPORTED_TESTS); foreach (var trait in traits) { diff --git a/tests/Tests/SKDataTest.cs b/tests/Tests/SKDataTest.cs index 022f71ce..dc0c0816 100644 --- a/tests/Tests/SKDataTest.cs +++ b/tests/Tests/SKDataTest.cs @@ -47,6 +47,17 @@ namespace SkiaSharp.Tests Assert.True(data.Size > 0); } + [SkippableFact] + public void DataCanBeCreatedFromManagedStream() + { + using var managed = File.OpenRead(Path.Combine(PathToImages, "baboon.jpg")); + using var stream = new SKManagedStream(managed); + using var data = SKData.Create(stream); + + Assert.NotNull(data); + Assert.True(data.Size > 0); + } + [SkippableFact] public void DataCanBeCreatedFromFile() {