Esempio n. 1
0
        public void TestSaveRaw()
        {
            // Make sure the stream is at the beginning of the file
            commonStream.Position = 0;
            Uri uri = new Uri("TestFile.jpg", UriKind.Relative);
            IOStorage s = new IOStorage(uri);

            // Create a stream with image data
            byte[] buffer = new byte[commonStream.Length];
            commonStream.Read(buffer, 0, (int)commonStream.Length);

            s.Save(buffer, commonStream.Length);
            StorageStream strm = new StorageStream(s.Load());
            Assert.IsTrue(commonStream.Length == strm.Length);

            IOStorage.GetUserFileArea.DeleteFile(uri.OriginalString);
        }
Esempio n. 2
0
 public void TestLoadWithoutUrl()
 {
     IOStorage s = new IOStorage();
     s.Load();
 }
Esempio n. 3
0
        public void TestRemove()
        {
            // Make sure the stream is at the beginning of the file
            commonStream.Position = 0;
            Uri uri = new Uri("TestFile.jpg", UriKind.Relative);
            IOStorage s = new IOStorage(uri);

            // Create a stream with image data
            byte[] buffer = new byte[commonStream.Length];
            commonStream.Read(buffer, 0, (int)commonStream.Length);

            // save it then remove it.
            s.Save(buffer, commonStream.Length);
            s.Remove();
            StorageStream strm = new StorageStream(s.Load());
        }
Esempio n. 4
0
        public void TestDefaultLoadwithFileNotFound()
        {
            // delete the file from the setup method
            IOStorage.GetUserFileArea.DeleteFile(commonUri.OriginalString);

            Uri uri = new Uri("SplashScreenImage.jpg", UriKind.Relative);
            IOStorage s = new IOStorage(uri);
            s.Load();
        }