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 }
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 }