示例#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");
 }
示例#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) {
            }
        }
示例#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) {
            }
        }
示例#4
0
 public void ReadableSeekableFullStream ()
 {
     stream = new FakeStream (true, false, true);
     stream.Write (new byte [10], 0, 10);
     package = Package.Open (stream);
 }
示例#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) {

            }
        }
示例#6
0
 public void ReadableStream ()
 {
     stream = new FakeStream (true, false, false);
     package = Package.Open (stream);
 }
示例#7
0
 public virtual void Setup()
 {
     stream  = new FakeStream();
     package = Package.Open(stream, FileMode.Create);
 }
示例#8
0
 public void UnusableStream ()
 {
     stream = new FakeStream (false, false, false);
     package = Package.Open (stream);
 }
示例#9
0
 public void SetTruncateOnWriteablePath ()
 {
     stream = new FakeStream (true, true, true);
     File.Create (path).Close ();
     package = Package.Open (path, FileMode.Truncate);
 }
示例#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");
 }
示例#11
0
 public void SetTruncateOnWriteableStream()
 {
     stream  = new FakeStream(true, true, true);
     package = Package.Open(stream, FileMode.Truncate);
 }
示例#12
0
 public void SetAppendOnWriteableStream()
 {
     stream  = new FakeStream(true, true, true);
     package = Package.Open(stream, FileMode.Append);
 }
示例#13
0
 public void ReadableStream()
 {
     stream  = new FakeStream(true, false, false);
     package = Package.Open(stream);
 }
示例#14
0
 public void ReadableSeekableFullStream()
 {
     stream = new FakeStream(true, false, true);
     stream.Write(new byte [10], 0, 10);
     package = Package.Open(stream);
 }
示例#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) {

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