public void TestConvertFromValidStringToObjectId()
        {
            var s = "0102030405060708090a0b0c";
            var expected = new ObjectId(s);
            var converter = new ObjectIdConverter();

            var res = converter.ConvertFrom(s);

            Assert.AreEqual(typeof(ObjectId), res.GetType());
            Assert.AreEqual(expected, res);
        } 
        public void TestConvertFromObjectIdToString()
        {
            var expected = "0102030405060708090a0b0c";
            var id = new ObjectId(expected);
            var converter = new ObjectIdConverter();

            var res = converter.ConvertTo(id, typeof(string));
           
            Assert.AreEqual(typeof(string), res.GetType());
            Assert.AreEqual(expected, res);
        }
        public void TestConvertFromObjectIdToDateTime()
        {
            var expected = new DateTime(2011, 1, 2, 3, 4, 5, DateTimeKind.Utc);
            var id = ObjectId.GenerateNewId(expected);

            var converter = new ObjectIdConverter();

            var res = converter.ConvertTo(id, typeof(DateTime));

            Assert.AreEqual(typeof(DateTime), res.GetType());
            Assert.AreEqual(expected, res);
        }
 public void TestCanConvertFromString()
 {
     var converter = new ObjectIdConverter();
     Assert.IsTrue(converter.CanConvertFrom(typeof (string)));
 }
 public void TestCanConvertToDateTime()
 {
     var converter = new ObjectIdConverter();
     Assert.IsTrue(converter.CanConvertTo(typeof (DateTime)));
 }