Esempio n. 1
0
 public static decimal Decimal_BSONtoCLR(BSONInt64Element el)
 {
   return el.Value / DECIMAL_LONG_MUL;
 } 
Esempio n. 2
0
        public void TestInt64ElementIConvertable()
        {
            var element = new BSONInt64Element("name", 1256000000000);

              var bl = element.AsBool();
              var date = element.AsDateTime();
              var decim = element.AsDecimal();
              var doubl = element.AsDouble();
              var int64 = element.AsLong();
              var single = element.AsFloat();
              var str = element.AsString();
              var uint64 = element.AsULong();

              Assert.AreEqual(bl, true);
              Assert.AreEqual(date, new DateTime(1256000000000));
              Assert.AreEqual(decim, 1256000000000);
              Assert.AreEqual(doubl, 1256000000000.0D);
              Assert.AreEqual(int64, 1256000000000);
              Assert.AreEqual(single, 1256000000000);
              Assert.AreEqual(str, "1256000000000");
              Assert.AreEqual(uint64, 1256000000000);
        }