Ejemplo n.º 1
0
 public void SetCreateNewOnWriteableStream2()
 {
     stream = new FakeStream(true, true, true);
     stream.Write(new byte [1000], 0, 1000);
     package = Package.Open(stream, FileMode.CreateNew);
     Assert.AreEqual(0, stream.Length, "#1");
 }
Ejemplo n.º 2
0
        public void ReadOnlyAccess()
        {
            stream  = new FakeStream(true, false, true);
            package = Package.Open(path, FileMode.CreateNew, FileAccess.Read);

            try {
                package.DeleteRelationship(contentType);
                Assert.Fail("Cannot modify a read-only package");
            } catch (IOException) {
            }
        }
Ejemplo n.º 3
0
        public void ReadableSeekableStream()
        {
            stream  = new FakeStream(true, false, true);
            package = Package.Open(stream);

            try {
                package.DeleteRelationship(contentType);
                Assert.Fail("Cannot modify a read-only package");
            } catch (IOException) {
            }
        }
Ejemplo n.º 4
0
 public void ReadableSeekableFullStream ()
 {
     stream = new FakeStream (true, false, true);
     stream.Write (new byte [10], 0, 10);
     package = Package.Open (stream);
 }
Ejemplo n.º 5
0
        public void ReadableSeekableStream ()
        {
            stream = new FakeStream (true, false, true);
            package = Package.Open (stream);

            try {
                package.DeleteRelationship (contentType);
                Assert.Fail ("Cannot modify a read-only package");
            } catch (IOException) {

            }
        }
Ejemplo n.º 6
0
 public void ReadableStream ()
 {
     stream = new FakeStream (true, false, false);
     package = Package.Open (stream);
 }
Ejemplo n.º 7
0
 public virtual void Setup()
 {
     stream  = new FakeStream();
     package = Package.Open(stream, FileMode.Create);
 }
Ejemplo n.º 8
0
 public void UnusableStream ()
 {
     stream = new FakeStream (false, false, false);
     package = Package.Open (stream);
 }
Ejemplo n.º 9
0
 public void SetTruncateOnWriteablePath ()
 {
     stream = new FakeStream (true, true, true);
     File.Create (path).Close ();
     package = Package.Open (path, FileMode.Truncate);
 }
Ejemplo n.º 10
0
 public void SetCreateNewOnWriteableStream2 ()
 {
     stream = new FakeStream (true, true, true);
     stream.Write (new byte [1000], 0, 1000);
     package = Package.Open (stream, FileMode.CreateNew);
     Assert.AreEqual (0, stream.Length, "#1");
 }
Ejemplo n.º 11
0
 public void SetTruncateOnWriteableStream()
 {
     stream  = new FakeStream(true, true, true);
     package = Package.Open(stream, FileMode.Truncate);
 }
Ejemplo n.º 12
0
 public void SetAppendOnWriteableStream()
 {
     stream  = new FakeStream(true, true, true);
     package = Package.Open(stream, FileMode.Append);
 }
Ejemplo n.º 13
0
 public void ReadableStream()
 {
     stream  = new FakeStream(true, false, false);
     package = Package.Open(stream);
 }
Ejemplo n.º 14
0
 public void ReadableSeekableFullStream()
 {
     stream = new FakeStream(true, false, true);
     stream.Write(new byte [10], 0, 10);
     package = Package.Open(stream);
 }
Ejemplo n.º 15
0
        public void ReadOnlyAccess ()
        {
            stream = new FakeStream (true, false, true);
            package = Package.Open (path, FileMode.CreateNew, FileAccess.Read);

            try {
                package.DeleteRelationship (contentType);
                Assert.Fail ("Cannot modify a read-only package");
            } catch (IOException) {

            }
        }
Ejemplo n.º 16
0
 public void SetTruncateOnWriteablePath()
 {
     stream = new FakeStream(true, true, true);
     File.Create(path).Close();
     package = Package.Open(path, FileMode.Truncate);
 }
Ejemplo n.º 17
0
 public void SetAppendOnWriteableStream ()
 {
     stream = new FakeStream (true, true, true);
     package = Package.Open (stream, FileMode.Append);
 }
Ejemplo n.º 18
0
 public void StreamCreate()
 {
     stream  = new FakeStream(true, true, true);
     package = Package.Open(stream, FileMode.Create);
 }
Ejemplo n.º 19
0
 public void SetTruncateOnWriteableStream ()
 {
     stream = new FakeStream (true, true, true);
     package = Package.Open (stream, FileMode.Truncate);
 }
Ejemplo n.º 20
0
 public void UnusableStream()
 {
     stream  = new FakeStream(false, false, false);
     package = Package.Open(stream);
 }
Ejemplo n.º 21
0
 public void StreamCreate ()
 {
     stream = new FakeStream (true, true, true);
     package = Package.Open (stream, FileMode.Create);
 }
Ejemplo n.º 22
0
 public void CorruptStream()
 {
     stream = new FakeStream(true, true, true);
     stream.Write(new byte [1024], 0, 1024);
     package = Package.Open(stream);
 }
Ejemplo n.º 23
0
 public void CorruptStream ()
 {
     stream = new FakeStream (true, true, true);
     stream.Write (new byte [1024], 0, 1024);
     package = Package.Open (stream);
 }
Ejemplo n.º 24
0
 public virtual void Setup ()
 {
     stream = new FakeStream ();
     package = Package.Open (stream, FileMode.Create);
 }