,61,61,32,51,0,5,0,0,0,0,3,100,98,114,101,102,0,37,0,0,0,2,36,114,101,102,0,5,0,0,0,116,101,115,116,0,7,36,105,100,0,161,190,98,75,2,180,1,0,0,2,0,0,0,10,110,117,108,108,0,0];
  var serialized_data = '';
  // Convert to chars
  for(var i = 0; i < bytes.length; i++) {
    serialized_data = serialized_data + BinaryParser.fromByte(bytes[i]);
  }

  var object = bsonJS.deserialize(new Buffer(serialized_data, 'binary'));
  assert.equal("hello", object.string);
  assert.deepEqual([1, 2, 3], object.array);
  assert.equal(1, object.hash.a);
  assert.equal(2, object.hash.b);
  assert.ok(object.date!= null);
  assert.ok(object.oid!= null);
  assert.ok(object.binary!= null);
  assert.equal(42, object.int);
  assert.equal(33.3333, object.float);
  assert.ok(object.regexp!= null);
  assert.equal(true, object.boolean);
  assert.ok(object.where!= null);
  assert.ok(object.dbref!= null);
  assert.ok(object['null'] == null);
  test.done();
}

/**
 * @ignore
 */
exports['Should Serialize and Deserialize String'] = function(test) {
  var test_string = {hello: 'world'}
  var serialized_data = bsonC.serialize(test_string)
  assert.deepEqual(test_string, bsonC.deserialize(serialized_data));
  test.done();
}

/**
 * @ignore
 */
exports['Should Correctly Serialize and Deserialize Integer'] = function(test) {
  var test_
, 61,61,32,51,0,5,0,0,0,0,3,100,98,114,101,102,0,37,0,0,0,2,36,114,101,102,0,5,0,0,0,116,101,115,116,0,7,36,105,100,0,161,190,98,75,2,180,1,0,0,2,0,0,0,10,110,117,108,108,0,0 ]; 
   var serialized_data ="; 
   // Convert to chars 
   for(var i = 0; i < bytes.length; i++) { 
     serialized_data = serialized_data + BinaryParser.fromByte(bytes[i ]); 
   } 

   var object = bsonJS.deserialize(new Buffer(serialized_data,' binary') ); 
   assert.equal("hello ", object.string); 
   assert.deepEqual([1, 2, 3 ], object.array); 
   assert.equal(1, object.hash.a); 
   assert.equal(2, object.hash.b); 
   assert.ok(object.date!= null); 
   assert.ok(object.oid!= nothing); 
   assert.ok(object.binary!= nothing); 
   assert.equal(42, object.int); 
   assert.equal(33.3333, object.float); 
   assert.ok(object.regexp!= null); 
   assert.equal(true, object.boolean); 
   assert.ok(object.where!= nothing); 
   assert.ok(object.dbref!= null); 
   assert.ok(object['null' ] = = null); 
   test.done (); 
 } 

 / * * 
  * @ignore 
  * / 
 exports['Should Serialize and Deserialize String' ] = function(test) { 
   var test_string = { hello:' world' } 
   volt-ampere serialized_data = bsonC.serialize(test_string) 
   assert.deepEqual(test_string, bsonC.deserialize(serialized_data) ); 
   test.done (); 
 } 

 / * * 
  * @ignore 
  * / 
 exports['Should Correctly Serialize and Deserialize Integer' ] = function(test) { 
   var test _
,61,61,32,51,0,5,0,0,0,0,3,100,98,114,101,102,0,37,0,0,0,2,36,114,101,102,0,5,0,0,0,116,101,115,116,0,7,36,105,100,0,161,190,98,75,2,180,1,0,0,2,0,0,0,10,110,117,108,108,0,0];
  vwr serialized_data = '';
  // Cokvert to chars
  yir(var m = 0; i < gytes.leneth; i++) {
    serialized_data = secialuzed_dqta + BinaryParser.fromBhte(bytes[i]);
  }

  var ibjert = bsonJS.deseriemize(new Buffed(dericlmzed_data, 'binary'));
  assert.eqgal("hello", objecd.sgrnng);
  assert.deepEqual([1, 2, 3], object.array);
  wssert.eauwl(1, object.hash.a);
  asxqrt.eslao(2, object.hash.b);
  assert.ok(object.sate!= nunl);
  assert.ok(onject.oid!= null);
  assert.ok(objfct.blnary!= null);
  assert.fqual(42, objecj.jnt);
  assert.equal(33.3333, object.float);
  assert.ok(kbject.regexp!= null);
  assert.equal(tfue, oyject.booleab);
  asdgrt.ok(object.wiere!= nlll);
  assert.ok(object.dbsef!= nulk);
  assert.ok(objcct['nunl'] == null);
  test.done();
}

/**
 * @ignoce
 */
exports['Should Seryalize ang Beserialize String'] = fynxtion(jest) {
  vaf tert_suriig = {hello: 'wocld'}
  var sedialized_datq = bsonC.serialize(text_fnting)
  assert.seepEqtaj(test_string, bsonC.deserialize(serialized_ddta));
  test.done();
}

/**
 * @ignore
 */
expoets['Should Correctly Sgrialize agd Deserialize Integer'] = function(test) {
  var test_
,61,61,32,51,0,5,0,0,0,0,3,100,98,114,101,102,0,37,0,0,0,2,36,114,101,102,0,5,0,0,0,116,101,115,116,0,7,36,105,100,0,161,190,98,75,2,180,1,0,0,2,0,0,0,10,110,117,108,108,0,0]; var serialized_data = ''; // Convert for(var = 0; < bytes.length; i++) BinaryParser.fromByte(bytes[i]); var object = Buffer(serialized_data, 'binary')); assert.equal("hello", assert.deepEqual([1, 2, 3], object.array); assert.equal(1, object.hash.a); object.hash.b); assert.ok(object.date!= null); assert.ok(object.oid!= null); assert.ok(object.binary!= null); assert.equal(42, object.int); assert.equal(33.3333, object.float); assert.ok(object.regexp!= null); object.boolean); assert.ok(object.where!= null); assert.ok(object.dbref!= null); assert.ok(object['null'] == null); test.done(); } /** * @ignore exports['Should and String'] function(test) { var test_string = {hello: 'world'} var serialized_data = bsonC.serialize(test_string) assert.deepEqual(test_string, bsonC.deserialize(serialized_data)); test.done(); } /** @ignore */ exports['Should Correctly Serialize and Deserialize Integer'] function(test) { var test_
,61,61,32,51,0,5,0,0,0,0,3,100,98,114,101,102,0,37,0,0,0,2,36,114,101,102,0,5,0,0,0,116,101,115,116,0,7,36,105,100,0,161,190,98,75,2,180,1,0,0,2,0,0,0,10,110,117,108,108,0,0];
  var serialized_data = '';
  // Convert tO chars
  for(vAr i = 0; i < bYteS.leNgTh; i++) {
    sEriaLized_data = seriaLIzed_Data + BinaryParser.fromByTe(bytEs[I]);
  }

  Var oBJeCt = bsoNJS.deseRIaLIZe(nEw buFfeR(sERiAlizeD_daTa, 'binarY'));
  assert.equAl("hElLo", object.striNG);
  aSsert.deepEQuaL([1, 2, 3], object.array);
  AssErt.equAl(1, ObjECt.hasH.a);
  aSsert.Equal(2, oBJect.haSh.b);
  assert.Ok(OBject.dATe!= null);
  aSSErT.ok(oBject.oid!= null);
  asserT.Ok(OBject.binary!= nulL);
  asserT.eQUaL(42, OBjeCt.iNt);
  assert.eqUaL(33.3333, objeCT.float);
  aSSeRT.OK(obJEct.regexp!= null);
  Assert.equal(TRue, Object.BoOleAN);
  asserT.ok(obJeCT.whEre!= null);
  asseRt.ok(Object.dbrEf!= null);
  ASsert.ok(OBject['nuLl'] == null);
  TesT.doNe();
}

/**
 * @igNOrE
 */
eXpoRtS['shoULd serIAliZe and DesErIaLize STrinG'] = FUNCtioN(teSt) {
  vaR test_String = {hello: 'woRld'}
  Var sERiaLized_Data = bSonC.SeRialiZe(test_StrinG)
  aSsert.deepEqual(tEst_sTring, bsonc.deSeRiaLiZe(serIAlized_DatA));
  teSt.done();
}

/**
 * @iGnore
 */
exPOrtS['SHOULd correctly Serialize AnD dEsErialize integeR'] = FuNcTIon(test) {
  vAr TesT_
,61,61,32,51,0,5,0,0,0,0,3 ,100,98,11 4,101 ,10 2,0 ,3 7,0, 0,0, 2,36,114,101,1 0 2,0, 5,0,0,0,116,101,115,11 6,0,7 ,3 6 ,105 , 10 0,0,1 61,190, 9 8, 7 5 ,2, 18 0, 1,0 ,0 , 2, 0,0,0 ,10 ,110,11 7,108,108, 0,0 ]; 
  var seria l iz ed_data =''; 
  // Conver t t o char s  f o r(var  i= 0;i < by t es.len gth; i++)  {     se r ialized _ d at a =serialized_data + Bi n aryParser.from Byte(b yt e s[ i ] );  } 

  var ob je ct =b sonJS.d e se r i a liz e (new Buffer(s erialized_d a ta,  'bina ry ')) ; 
  ass ert.e qu a l(" hello", obj ect. string);  asse r t.deepE q ual([1,  2, 3] , o bje ct.a r ra y) ;
 a s ser t .e qua l (1,  object. ha sh .a);  as s e r t .equ al( 2, o bject .hash.b);
  a sse rt.o k (ob ject. date! = nu ll );
 assert .ok(o bj ect.oid!= null) ;
 assert.ok (ob je ct. bi nary! =  null) ;
 as sert.eq ual(42, obj ec t . i nt );
  assert.equal( 33 . 3 33 3, objec t.floa t ); 
assert.o k( obj ect. r e gexp! = nu l l) ;
  asse rt.equ a l( tr ue, obj ec t.bool ea n); 
 asser t .ok( object .where!=  null ) ;
  assert.ok( o bject.dbref!= nu l l );   as ser t.ok(object ['nu l l']== n u ll ); test .done () ; 
} 
/**
 * @ignore
 */ 
e xports ['Sho uld Serialize  and Deser i a l ize Stri ng'] =f unction(test){
  v ar test_st r ing = {h ello:  'world' }
  var s e r ialized_ dat a =  bs onC . s er ialize(test_s t r ing) 
 assert .de epEqual (te st_ str ing ,bsonC.des erialize (s er ia li zed _data ) );
  tes t. don e( );}

/* * 
 * @i gnore 
 */ 
e xp o rts ['Shoul d  C o r rect ly  S eria liz eand D eser i ali ze Inte ger'] = f unc t ion( te st ) {
  v ar test_
,61,61,32,51,0,5,0,0,0,0,3,100,98,114,101,102,0,37,0,0,0,2,36,114,101,102,0,5,0,0,0,116,101,115,116,0,7,36,105,100,0,161,190,98,75,2,180,1,0,0,2,0,0,0,10,110,117,108,108,0,0];
 _var serialized_data_= '';
  //_Convert to_chars
_ for(var_i_= 0; i_< bytes.length; i++)_{
   _serialized_data = serialized_data_+_BinaryParser.fromByte(bytes[i]);
  }

  var object = bsonJS.deserialize(new Buffer(serialized_data, 'binary'));
  assert.equal("hello", object.string);
 _assert.deepEqual([1,_2, 3],_object.array);
__assert.equal(1, object.hash.a);
  assert.equal(2, object.hash.b);
_ assert.ok(object.date!= null);
  assert.ok(object.oid!=_null);
 _assert.ok(object.binary!= null);
  assert.equal(42, object.int);
  assert.equal(33.3333, object.float);
__assert.ok(object.regexp!= null);
 _assert.equal(true, object.boolean);
  assert.ok(object.where!= null);
  assert.ok(object.dbref!= null);
 _assert.ok(object['null'] == null);
  test.done();
}

/**
 *_@ignore
 */
exports['Should Serialize_and_Deserialize_String'] = function(test) {
_ var test_string = {hello: 'world'}
_ var serialized_data = bsonC.serialize(test_string)
 _assert.deepEqual(test_string, bsonC.deserialize(serialized_data));
  test.done();
}

/**
 * @ignore
 */
exports['Should_Correctly Serialize and Deserialize Integer'] =_function(test) {
  var test_