コード例 #1
0
        public void TestGetResource()
        {
            // Get a known customer
            var    qry    = this.nhib.Users.Where(u => u.Id == 1);
            object result = update.GetResource(qry, typeof(User).FullName);

            Assert.IsNotNull(result, "GetResource failed to return a value");

            User user = result as User;

            Assert.IsInstanceOfType(typeof(User), user, "GetResource returned wrong type");
            Assert.IsTrue(user.Id == 1, "GetResource returned wrong instance");

            // Clear it so we're not in an unsafe state
            update.ClearChanges();
        }