public void HashThrowTest() { string TestHash = TextToHash(HashText).Remove(0, 1); Param TestParam = new Param(); Assert.Throws <ArgumentException>(delegate { using Stream _ = Hashicon.GenerateAsStream(TestHash, TestParam); });
public void GenerateJpgStreamTest() { string TestHash = TextToHash(HashText); Param TestParam = new Param { RenderMode = Enums.RenderModeEnum.Jpg, Size = 1000 }; using MemoryStream TestStream = Hashicon.GenerateAsStream(TestHash, TestParam) as MemoryStream; using FileStream TestFileStream = new FileStream(FilePathJpgStream, FileMode.OpenOrCreate, FileAccess.Write); byte[] TestBytes = TestStream.ToArray(); TestFileStream.Write(TestBytes, 0, TestBytes.Length); }
public void GenerateJpgBase64Test() { string TestHash = TextToHash(HashText); Param TestParam = new Param { RenderMode = Enums.RenderModeEnum.Jpg, Size = 1000 }; string TestBase64 = Hashicon.GenerateAsBase64(TestHash, TestParam); Output.WriteLine(TestBase64); byte[] TestBytes = Convert.FromBase64String(TestBase64); using FileStream TestFileStream = new FileStream(FilePathJpgBase64, FileMode.OpenOrCreate, FileAccess.Write); TestFileStream.Write(TestBytes, 0, TestBytes.Length); }