public void SaveImageTest() { TestHelper.InitializeAndClearCatrobatContext(); IStorage storage = new StoragePhone7(); string projectPath = "Tests/Data/SampleData/SampleProjects/test.catroid"; Uri uri = new Uri("/MetroCatUT;component/" + projectPath, UriKind.Relative); var resourceStreamInfo = Application.GetResourceStream(uri); CatrobatZip.UnzipCatrobatPackageIntoIsolatedStorage(resourceStreamInfo.Stream, "TestLoadImage"); byte[] image = storage.LoadImage("TestLoadImage/screenshot.png"); throw new NotImplementedException("TODO: check next line"); //storage.SaveImage("TestLoadImage2/screenshot.png", image); byte[] image2 = storage.LoadImage("TestLoadImage2/screenshot.png"); // TODO: Maybe check if pixels are corect? Assert.AreNotEqual(image, null); }
public void LoadImageTest() { TestHelper.InitializeAndClearCatrobatContext(); IStorage storage = new StoragePhone7(); string projectPath = "Tests/Data/SampleData/SampleProjects/test.catroid"; Uri uri = new Uri("/MetroCatUT;component/" + projectPath, UriKind.Relative); var resourceStreamInfo = Application.GetResourceStream(uri); CatrobatZip.UnzipCatrobatPackageIntoIsolatedStorage(resourceStreamInfo.Stream, "TestLoadImage"); byte[] image = storage.LoadImage("TestLoadImage/screenshot.png"); Assert.AreNotEqual(image, null); }