Esempio n. 1
0
 public void MinDateTime()
 {
     using (new SoodaTransaction())
     {
         DateTime result = PKDateTime.Linq().Min(d => d.Id);
         Assert.AreEqual(new DateTime(2000, 1, 1), result);
     }
 }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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");
            }
        }
Esempio n. 5
0
        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());
            }
        }