public void xgtime() { DateTime dt = DateTime.Now; TimeSpan ts = dt.TimeOfDay; XGTimeConverter c = new XGTimeConverter(); byte[] bs = c.ConvertToBytes(ts); TimeSpan ts2 = (TimeSpan)c.ConvertToObject(bs); int i1 = (int)ts.TotalSeconds; int i2 = (int)ts2.TotalSeconds; Assert.AreEqual(i1,i2); }
public void xgtime() { DateTime dt = DateTime.Now; TimeSpan ts = dt.TimeOfDay; XGTimeConverter c = new XGTimeConverter(); byte[] bs = c.ConvertToBytes(ts); TimeSpan ts2 = (TimeSpan)c.ConvertToObject(bs); int i1 = (int)ts.TotalSeconds; int i2 = (int)ts2.TotalSeconds; Assert.AreEqual(i1, i2); }