public void Test_NewBasicTimestampWithDatetime() { BasicTimestampVector btv = new BasicTimestampVector(10); DateTime time = new DateTime(1970, 01, 01, 8, 2, 33); BasicTimestamp bt = new BasicTimestamp(time); //Assert.AreEqual("1970/1/1T8:02:33",bt.getString()); }
public void Test_getInternalValue() { DBConnection db = new DBConnection(); db.connect(SERVER, PORT); BasicDate date = (BasicDate)db.run("2018.07.10"); int r = date.getInternalValue(); Assert.AreEqual(17722, r); BasicTimestamp timestamp = (BasicTimestamp)db.run("2018.07.10T10:12:13.005"); long l = timestamp.getInternalValue(); Assert.AreEqual(1531217533005, l); BasicTime time = (BasicTime)db.run("10:12:13.005"); int t = time.getInternalValue(); Assert.AreEqual(36733005, t); //min BasicMinute min = (BasicMinute)db.run("10:12m"); int m = min.getInternalValue(); Assert.AreEqual(612, m); //sec BasicSecond sec = (BasicSecond)db.run("10:12:11"); int s = sec.getInternalValue(); Assert.AreEqual(36731, s); //month BasicMonth mon = (BasicMonth)db.run("2018.07M"); int mo = mon.getInternalValue(); Assert.AreEqual(24222, mo); //nanotime BasicNanoTime nt = (BasicNanoTime)db.run("10:12:13.005002003"); long nti = nt.getInternalValue(); Assert.AreEqual(36733005002003, nti); //nanotimestamp BasicNanoTimestamp nts = (BasicNanoTimestamp)db.run("2018.07.10T10:12:13.005002003"); long ntsi = nts.getInternalValue(); Assert.AreEqual(1531217533005002003, ntsi); }