public void TestTwoBooleans() { var document = new BsonDocument(); using (var writer = new BsonDocumentWriter(document)) { writer.WriteStartDocument(); writer.WriteBoolean("a", true); writer.WriteBoolean("b", false); writer.WriteEndDocument(); } var json = document.ToJson(); var expected = "{ 'a' : true, 'b' : false }".Replace("'", "\""); ; Assert.Equal(expected, json); }
public void TestOneNestedBoolean() { var document = new BsonDocument(); using (var writer = new BsonDocumentWriter(document)) { writer.WriteStartDocument(); writer.WriteStartDocument("nested"); writer.WriteBoolean("a", true); writer.WriteEndDocument(); writer.WriteEndDocument(); } var json = document.ToJson(); var expected = "{ 'nested' : { 'a' : true } }".Replace("'", "\""); Assert.Equal(expected, json); }