mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-27 22:11:39 +00:00
added test helpers to write image to disk easily
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Raindrop.Tests
|
||||
{
|
||||
public class Helper
|
||||
{
|
||||
|
||||
//easily write to a file
|
||||
//filePath = fully-specified file path
|
||||
public static void WriteToFile(byte[] outbytes, string filePath)
|
||||
{
|
||||
//create parent subfolders
|
||||
var parentDir = Path.GetDirectoryName(filePath);
|
||||
System.IO.Directory.CreateDirectory(parentDir);
|
||||
|
||||
//write file
|
||||
System.IO.File.WriteAllBytes(filePath, outbytes);
|
||||
Debug.Log($"write: {filePath} ");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 651250a02e4a4314917e0f38c7b077a8
|
||||
timeCreated: 1642607248
|
||||
@@ -97,17 +97,6 @@ namespace Raindrop.Tests.ImagingTests
|
||||
|
||||
}
|
||||
|
||||
//filePath = fully-specified file path
|
||||
private void WriteToFile(byte[] outbytes, string filePath)
|
||||
{
|
||||
//create parent subfolders
|
||||
var parentDir = Path.GetDirectoryName(filePath);
|
||||
System.IO.Directory.CreateDirectory(parentDir);
|
||||
|
||||
//write file
|
||||
System.IO.File.WriteAllBytes(filePath, outbytes);
|
||||
Debug.Log($"write: {filePath} ");
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user