public void TestOneNestedMaxKey() { var document = new BsonDocument(); using (var writer = new BsonDocumentWriter(document)) { writer.WriteStartDocument(); writer.WriteStartDocument("nested"); writer.WriteMaxKey("a"); writer.WriteEndDocument(); writer.WriteEndDocument(); } var json = document.ToJson(); var expected = "{ 'nested' : { 'a' : MaxKey } }".Replace("'", "\""); Assert.Equal(expected, json); }
public void TestTwoMaxKeys() { var document = new BsonDocument(); using (var writer = new BsonDocumentWriter(document)) { writer.WriteStartDocument(); writer.WriteMaxKey("a"); writer.WriteMaxKey("b"); writer.WriteEndDocument(); } var json = document.ToJson(); var expected = "{ 'a' : MaxKey, 'b' : MaxKey }".Replace("'", "\""); ; Assert.Equal(expected, json); }
public void TestTwoNestedMaxKeys() { var document = new BsonDocument(); using (var writer = new BsonDocumentWriter(document)) { writer.WriteStartDocument(); writer.WriteStartDocument("nested"); writer.WriteMaxKey("a"); writer.WriteMaxKey("b"); writer.WriteEndDocument(); writer.WriteEndDocument(); } var json = document.ToJson(); var expected = "{ 'nested' : { 'a' : { '$maxkey' : 1 }, 'b' : { '$maxkey' : 1 } } }".Replace("'", "\""); Assert.AreEqual(expected, json); }