Ejemplo n.º 1
0
 public void TestNameTooLong()
 {
     var f = new VFSFile("0123456789");
     try
     {
         var o1 = TestHelper.CreateFileSystemOptions("");
         o1.NameLength = f.Name.Length;
         var p1 = new BlockParser(o1);
         p1.NodeToBytes(f);
     }
     catch (VFSException)
     {
         Assert.Fail("Exception unexpected yet");
     }
     var o2 = TestHelper.CreateFileSystemOptions("");
     o2.NameLength = f.Name.Length - 1;
     var p2 = new BlockParser(o2);
     p2.NodeToBytes(f);
 }
Ejemplo n.º 2
0
        public void TestWriteFolderBlock()
        {
            var options = TestHelper.CreateFileSystemOptions("");
            var b = new BlockParser(options);

            var f = new Folder("blubα");

            var bb = b.NodeToBytes(f);

            Assert.AreEqual(0x1, bb[0]);
        }
Ejemplo n.º 3
0
 public void TestInvalidNode()
 {
     var options = TestHelper.CreateFileSystemOptions("");
     var p = new BlockParser(options);
     p.NodeToBytes(new IndexNodeMock());
 }
Ejemplo n.º 4
0
        public void TestWriteAndPareseFolderBlock()
        {
            var options = TestHelper.CreateFileSystemOptions("");
            var b = new BlockParser(options);

            const string name = "blubα";

            var f1 = new Folder(name);

            var bb = b.NodeToBytes(f1);
            var f2 = b.BytesToNode(bb);

            Assert.AreEqual(name, f2.Name);
            Assert.IsInstanceOfType(f2, typeof(Folder));
        }