public void TestTryParseHexString() { var expected = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 255 }; var value = "000102030405060708090a0b0c0d0e0f10ff"; byte[] actual; var result = BsonUtils.TryParseHexString(value, out actual); Assert.True(result); Assert.Equal(expected, actual); }
public void TestTryParseHexStringOdd() { var expected = new byte[] { 0, 15 }; var value = "00f"; byte[] actual; var result = BsonUtils.TryParseHexString(value, out actual); Assert.IsTrue(result); Assert.AreEqual(expected, actual); }