Exemplo n.º 1
0
        public void TimeOnlyFieldTest()
        {
            MDEntryTime t = new MDEntryTime(new DateTime(2011, 11, 30, 8, 9, 10, 555), true);
            Assert.AreEqual("08:09:10.555", t.ToString());

            t = new MDEntryTime(new DateTime(2011, 11, 30, 8, 9, 10, 555), false);
            Assert.AreEqual("08:09:10", t.ToString());
        }
Exemplo n.º 2
0
        public void TimeOnlyFieldTest()
        {
            fieldmap.SetField(new TimeOnlyField(Tags.MDEntryTime, new DateTime(1, 1, 1, 1, 2, 3), false));
            MDEntryTime et = new MDEntryTime();

            fieldmap.GetField(et);
            Assert.AreEqual(new DateTime(1, 1, 1, 1, 2, 3).TimeOfDay, et.Obj.TimeOfDay);
            fieldmap.SetField(new MDEntryTime(new DateTime(1, 1, 1, 1, 2, 5)));
            TimeOnlyField r = fieldmap.GetField(et);

            Assert.AreEqual(new DateTime(1, 1, 1, 1, 2, 5).TimeOfDay, et.getValue().TimeOfDay);

            Assert.AreSame(r, et);
            Assert.AreEqual("01:02:05.000", et.ToString());
        }