void run() {
     Document document = fromBson( BSONObj() );
     ASSERT_EQUALS( 0U, document->getFieldCount() );
     document = fromBson( BSON( "a" << 1 << "b" << "q" ) );
     ASSERT_EQUALS( 2U, document->getFieldCount() );
     ASSERT_EQUALS( "a", getNthField(document, 0).first.toString() );
     ASSERT_EQUALS( 1,   getNthField(document, 0).second.getInt() );
     ASSERT_EQUALS( "b", getNthField(document, 1).first.toString() );
     ASSERT_EQUALS( "q", getNthField(document, 1).second.getString() );
     assertRoundTrips( document );
 }
Exemplo n.º 2
0
 void run() {
     Document document;
     ASSERT_EQUALS(0U, document.size());
     assertRoundTrips(document);
 }
 void run() {
     Document document;
     ASSERT_EQUALS( 0U, document->getFieldCount() );
     assertRoundTrips( document );
 }