Delete() публичный Метод

Permanently removes all files from the database that match the query.
public Delete ( Document query ) : void
query Document
Результат void
Пример #1
0
 public void TestDeleteRemovesChunks(){
     Object id;
     string filename = "deletebyname.txt";
     string fs = "fs";
     GridFile gf = new GridFile(DB,fs);
     using(GridFileStream gfs = gf.Create(filename, FileMode.CreateNew)){
         id = gfs.GridFileInfo.Id;
         TextWriter tw = new StreamWriter(gfs);
         tw.WriteLine("test");
         tw.Close();
     }
     Assert.AreEqual(1, CountChunks(fs, id), "Chunks not found");
     gf.Delete("deletebyname.txt");
     Assert.AreEqual(0, CountChunks(fs, id), "Chunks found");
 }
Пример #2
0
        public void TestDeleteRemovesChunks()
        {
            Object   id;
            string   filename = "deletebyname.txt";
            string   fs       = "fs";
            GridFile gf       = new GridFile(DB, fs);

            using (GridFileStream gfs = gf.Create(filename, FileMode.CreateNew)){
                id = gfs.GridFileInfo.Id;
                TextWriter tw = new StreamWriter(gfs);
                tw.WriteLine("test");
                tw.Close();
            }
            Assert.AreEqual(1, CountChunks(fs, id), "Chunks not found");
            gf.Delete("deletebyname.txt");
            Assert.AreEqual(0, CountChunks(fs, id), "Chunks found");
        }