aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/ImageHelper.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-19 01:44:29 +0800
committer杨宇千 <crupest@outlook.com>2019-08-19 01:44:29 +0800
commit9a674f6f3a15ef260868049d945d7afc930f093c (patch)
tree6dd38c932babe4be032385f27ddff50645d48b38 /Timeline.Tests/Helpers/ImageHelper.cs
parentcc646173d0667769c4f4ae78f51a626346d7e7ad (diff)
downloadtimeline-9a674f6f3a15ef260868049d945d7afc930f093c.tar.gz
timeline-9a674f6f3a15ef260868049d945d7afc930f093c.tar.bz2
timeline-9a674f6f3a15ef260868049d945d7afc930f093c.zip
Add integrated tests.
Diffstat (limited to 'Timeline.Tests/Helpers/ImageHelper.cs')
-rw-r--r--Timeline.Tests/Helpers/ImageHelper.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/ImageHelper.cs b/Timeline.Tests/Helpers/ImageHelper.cs
new file mode 100644
index 00000000..c5a9cf17
--- /dev/null
+++ b/Timeline.Tests/Helpers/ImageHelper.cs
@@ -0,0 +1,21 @@
+using SixLabors.ImageSharp;
+using SixLabors.ImageSharp.PixelFormats;
+using System.IO;
+
+namespace Timeline.Tests.Helpers
+{
+ public static class ImageHelper
+ {
+ public static byte[] CreatePngWithSize(int width, int height)
+ {
+ using (var image = new Image<Rgba32>(width, height))
+ {
+ using (var stream = new MemoryStream())
+ {
+ image.SaveAsPng(stream);
+ return stream.ToArray();
+ }
+ }
+ }
+ }
+}