public void MinDateTime() { using (new SoodaTransaction()) { DateTime result = PKDateTime.Linq().Min(d => d.Id); Assert.AreEqual(new DateTime(2000, 1, 1), result); } }
public void SelectMaxDateTime() { using (new SoodaTransaction()) { DateTime result = PKDateTime.Linq().Select(d => d.Id).Max(); Assert.AreEqual(new DateTime(2000, 1, 1, 2, 0, 0), result); } }
public void MaxDateTime() { using (new SoodaTransaction()) { IEnumerable <DateTime> de = from d in PKDateTime.Linq() group d by d.Id.Year into g select g.Max(d => d.Id); CollectionAssert.AreEqual(new DateTime[] { new DateTime(2000, 1, 1, 2, 0, 0) }, de); } }
public void DateTimeTest() { using (SoodaTransaction tran = new SoodaTransaction()) { PKDateTime test2 = PKDateTime.Load(new DateTime(2000, 1, 1, 1, 0, 0)); Assert.AreEqual(test2.Parent.Id, new DateTime(2000, 1, 1, 0, 0, 0)); Assert.AreEqual((string)test2.Parent.Data, "test data"); Assert.AreEqual((string)test2.Data, "test data 2"); } }
public void DateTimeTest() { string ser; using (SoodaTransaction tran = new SoodaTransaction()) { PKDateTime test = new PKDateTime(); PKDateTime test2 = PKDateTime.Load(new DateTime(2000, 1, 1, 0, 0, 0, 0)); Assert.AreEqual((string)test2.Data, "test data"); ser = tran.Serialize(); tran.Deserialize(ser); Assert.AreEqual(ser, tran.Serialize()); } }