Esempio n. 1
0
        public void TestNewOidFromToString()
        {
            var hex = "4B458B95D114BE541B000000";
            var firstOid = new Oid(hex);
            var secondOid = new Oid(firstOid.ToString());

            Assert.AreEqual(firstOid.ToString(), secondOid.ToString());
        }
Esempio n. 2
0
        public void TestDecode()
        {
            string hex = "4a7067c30a57000000008ecb";
            Oid oid = new Oid(hex);

            Assert.AreEqual(hex,"ObjectId(\"" + oid.ToString() + "\")");
        }
Esempio n. 3
0
        public void TestDecode()
        {
            string hex = "4a7067c30a57000000008ecb";
            Oid    oid = new Oid(hex);

            Assert.AreEqual("\"" + hex + "\"", oid.ToString());
        }
Esempio n. 4
0
        public void TestDecode()
        {
            string hex = "4a7067c30a57000000008ecb";
            Oid oid = new Oid(hex);

            Assert.AreEqual("\"" + hex + "\"", oid.ToString());
        }
Esempio n. 5
0
 public void TestQuoteCharacters()
 {
     bool thrown = false;
     Oid val = new Oid(@"""4a7067c30a57000000008ecb""");
     try{
         new Oid(val.ToString());
     }catch(ArgumentException ae){
         Assert.Fail("Creating an Oid from the json representation should not fail.");
     }
 }