Exemplo n.º 1
0
        public void Deserialize_BinaryData(string base64Input, BinarySubType binarySubType)
        {
            // { "foo" : new BinData(0, "AQID") }
            var bsonValue = AssertDecodedElement <BsonBinary>(base64Input);

            Assert.Equal(binarySubType, bsonValue.BinarySubType);
            Assert.Equal(new byte[] { 1, 2, 3 }, bsonValue.Bytes);
        }
Exemplo n.º 2
0
 public BsonBinary(BinarySubType binarySubType, byte[] bytes)
 {
     BinarySubType = binarySubType;
     Bytes         = bytes;
 }
Exemplo n.º 3
0
 public void Serialize_BinaryDocument(BinarySubType binarySubType, string expectedSerializationOutput) =>
 AssertSerialization(expectedSerializationOutput, new BsonBinary(binarySubType, new byte[] { 1, 2, 3 }));
Exemplo n.º 4
0
 public void ToString_BinaryData(BinarySubType binarySubType, string expectedToString) =>
 AssertToString(expectedToString, new BsonBinary(binarySubType, new byte[] { 1, 2, 3 }));