public void TestParse()
{
#pragma warning disable 618
byte[] bytes = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
var objectId1 = BsonObjectId.Parse("0102030405060708090a0b0c"); // lower case
var objectId2 = BsonObjectId.Parse("0102030405060708090A0B0C"); // upper case
Assert.IsTrue(objectId1.ToByteArray().SequenceEqual(objectId2.ToByteArray()));
Assert.IsTrue(objectId1.ToString() == "0102030405060708090a0b0c"); // ToString returns lower case
Assert.IsTrue(objectId1.ToString() == objectId2.ToString());
Assert.Throws<FormatException>(() => BsonObjectId.Parse("102030405060708090a0b0c")); // too short
Assert.Throws<FormatException>(() => BsonObjectId.Parse("x102030405060708090a0b0c")); // invalid character
Assert.Throws<FormatException>(() => BsonObjectId.Parse("00102030405060708090a0b0c")); // too long
#pragma warning restore
}