public void SaveImageShouldReturnImageSource() { var storage = new MemoryImageStorage(); var result = storage.Save(new byte[] { }); Assert.IsNotNull(result); }
public void ThumbnailIsLessThan10K() { var data = File.ReadAllBytes("Koala.jpg"); var storage = new MemoryImageStorage(); var sources = storage.Save(data); var result = storage.Retrieve(sources.Thumbnail); File.WriteAllBytes(@"C:\temp\" + sources.Thumbnail, result); Assert.IsNotNull(result); Assert.IsTrue(result.Length < 10000); }
public void RetrieveImagShouldReturnImage() { var data = File.ReadAllBytes("Koala.jpg"); var storage = new MemoryImageStorage(); var sources = storage.Save(data); var result = storage.Retrieve(sources.Source); Assert.IsNotNull(result); Assert.IsTrue(data.Length == result.Length); var index = 0; foreach (var @byte in data) { Assert.IsTrue(@byte == result[index]); index++; } }