예제 #1
0
        public void TestQuery()
        {
            var user = new CoUser {
                Name = "tom", Location = { Phone = "123456", Address = "The east of queen street" }
            };

            user.Save();

            var ru = CoUser.FindOne(p => p.Location.Phone == "123456");

            Assert.AreEqual("The east of queen street", ru.Location.Address);
        }
예제 #2
0
        public void Test1()
        {
            var user = new CoUser {
                Name = "tom", Location = { Phone = "123456", Address = "The east of queen street" }
            };

            user.Save();

            user = CoUser.FindById(user.Id);
            Assert.IsNotNull(user);
            Assert.AreEqual("tom", user.Name);
            Assert.AreEqual("123456", user.Location.Phone);
            Assert.AreEqual("The east of queen street", user.Location.Address);
        }