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);
     }
 }