Пример #1
0
        public void GetTypedValues()
        {
            TypedValue[] typedValues;
            using (ISession session = factory.OpenSession())
            {
                CreateObjects(typeof(Simple), session);
                typedValues = _conjunction.GetTypedValues(criteria, criteriaQuery);
            }

            TypedValue[] expectedTV = new TypedValue[2];
            expectedTV[0] = new TypedValue(NHibernateUtil.Int32, 5, EntityMode.Poco);
            expectedTV[1] = new TypedValue(NHibernateUtil.Int32, 10, EntityMode.Poco);

            Assert.AreEqual(2, typedValues.Length);

            for (int i = 0; i < typedValues.Length; i++)
            {
                Assert.AreEqual(expectedTV[i].Type, typedValues[i].Type);
                Assert.AreEqual(expectedTV[i].Value, typedValues[i].Value);
            }
        }