Exemplo n.º 1
0
        public void FileStore_RaptorDB_File_Roundtrip_Test()
        {
            //var filename = "test.cache";
            IFileStore target = null;

            try {
                var fi = new FileInfo(@"img\Patern_test.jpg");
                target = new NMaier.SimpleDlna.FileStore.RaptorDB.FileStore();
                target.Init();
                var f1    = new StoreItemMock(fi);
                var data  = File.ReadAllBytes(fi.FullName);
                var data2 = File.ReadAllBytes(fi.FullName);
                target.MaybeStoreFile(f1, data, data2);
                //var f1Cover = target.MaybeGetCover(f1);
                var f2 = target.MaybeGetFile(fi);
                Assert.IsNotNull(f2);
            }
            finally {
                if (target != null)
                {
                    var filename = target.StoreFile;
                    target.Dispose();
                    if ((filename != null) && File.Exists(filename))
                    {
                        File.Delete(filename);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void FileStore_RaptorDB_File_Roundtrip_Test()
 {
     //var filename = "test.cache";
       IFileStore target = null;
       try {
     var fi = new FileInfo(@"img\Patern_test.jpg");
     target = new NMaier.SimpleDlna.FileStore.RaptorDB.FileStore();
     target.Init();
     var f1 = new StoreItemMock(fi);
     var data = File.ReadAllBytes(fi.FullName);
     var data2 = File.ReadAllBytes(fi.FullName);
     target.MaybeStoreFile(f1, data, data2);
     //var f1Cover = target.MaybeGetCover(f1);
     var f2 = target.MaybeGetFile(fi);
     Assert.IsNotNull(f2);
       }
       finally {
     if (target != null) {
       var filename = target.StoreFile;
       target.Dispose();
       if ((filename != null) && File.Exists(filename)) File.Delete(filename);
     }
       }
 }