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

TODO Fix any accidental reordering issues.
public CopyTo ( Document dest ) : void
dest Document
Результат void
Пример #1
0
 public void TestCopyToCopiesAndOverwritesKeys()
 {
     Document d = new Document();
     Document dest = new Document();
     dest["two"] = 200;
     d["one"] = 1;
     d.Add("two", 2);
     d["three"] = 3;
     d.CopyTo(dest);
     Assert.AreEqual(2, dest["two"]);
 }
Пример #2
0
        public void TestCopyToCopiesAndOverwritesKeys()
        {
            Document d    = new Document();
            Document dest = new Document();

            dest["two"] = 200;
            d["one"]    = 1;
            d.Add("two", 2);
            d["three"] = 3;
            d.CopyTo(dest);
            Assert.AreEqual(2, dest["two"]);
        }
Пример #3
0
 public void TestCopyToCopiesAndPreservesKeyOrderToEmptyDoc()
 {
     Document d = new Document();
     Document dest = new Document();
     d["one"] = 1;
     d.Add("two", 2);
     d["three"] = 3;
     d.CopyTo(dest);
     int cnt = 1;
     foreach(String key in dest.Keys){
         Assert.AreEqual(cnt, d[key]);
         cnt++;
     }
 }
Пример #4
0
        public void TestCopyToCopiesAndPreservesKeyOrderToEmptyDoc()
        {
            Document d    = new Document();
            Document dest = new Document();

            d["one"] = 1;
            d.Add("two", 2);
            d["three"] = 3;
            d.CopyTo(dest);
            int cnt = 1;

            foreach (String key in dest.Keys)
            {
                Assert.AreEqual(cnt, d[key]);
                cnt++;
            }
        }
Пример #5
0
 static void DoBulkInsert(Database db, string col, Document doc, int size)
 {
     for(int i = 0; i < perTrial / size; i++){
         Document[] docs = new Document[size];
         for(int f = 0; f < docs.Length; f++){
             Document ins = new Document();
             doc.CopyTo(ins);
             docs[f] = ins;
         }
         db[col].Insert(docs);
     }
 }
Пример #6
0
 static void DoInsert(Database db, string col, Document doc)
 {
     for(int i = 0; i < perTrial; i++){
         Document ins = new Document();
         doc.CopyTo(ins);
         ins.Append("x", i);
         db[col].Insert(ins);
     }
 }