示例#1
0
文件: Objects.cs 项目: jamietre/IQMap
        public void Constructors()
        {
            TestObjectConstructor test= new TestObjectConstructor();
            var classInfo = IQ.MapperCache.GetClassInfo(test.GetType());

            Assert.AreEqual("testTableConstructor", classInfo.Query.TableName);
            ISqlQueryMaker query = classInfo.GetQuery();
            Assert.AreEqual("testTableConstructorView", query.From);

            try
            {
                test = IQ.From<TestObjectConstructor>(12345).First();
            }
            catch { }

            Assert.AreEqual("SELECT TOP 1 PK,FirstName,HowMuch FROM testTableConstructorView WHERE (defaultWhere=1) AND pk=@pk", TC.Controller.LastQuery.GetQuery());
            // TODO: Add tests for complex queries based on the oroginal query object
        }
示例#2
0
        public void Constructors()
        {
            TestObjectConstructor test = new TestObjectConstructor();
            var classInfo = IQ.MapperCache.GetClassInfo(test.GetType());

            Assert.AreEqual("testTableConstructor", classInfo.Query.TableName);
            ISqlQueryMaker query = classInfo.GetQuery();

            Assert.AreEqual("testTableConstructorView", query.From);

            try
            {
                test = IQ.From <TestObjectConstructor>(12345).First();
            }
            catch { }

            Assert.AreEqual("SELECT TOP 1 PK,FirstName,HowMuch FROM testTableConstructorView WHERE (defaultWhere=1) AND pk=@pk", TC.Controller.LastQuery.GetQuery());
            // TODO: Add tests for complex queries based on the oroginal query object
        }