コード例 #1
0
ファイル: CommonTest.cs プロジェクト: leohsu91/DbEntry
        public void TestNoLazy()
        {
            Nolazy.Where(Condition.Empty).Select();
            AssertSql("SELECT [Id],[No],[Name] FROM [Nolazy];\n<Text><60>()");

            Nolazy.Where(Condition.Empty).SelectDistinct();
            AssertSql("SELECT DISTINCT [Id],[No],[Name] FROM [Nolazy];\n<Text><60>()");

            Nolazy.Where(Condition.Empty).SelectNoLazy();
            AssertSql("SELECT [Id],[No],[Name],[Content] AS [$Content] FROM [Nolazy];\n<Text><60>()");

            Nolazy.Where(Condition.Empty).SelectDistinctNoLazy();
            AssertSql("SELECT DISTINCT [Id],[No],[Name],[Content] AS [$Content] FROM [Nolazy];\n<Text><60>()");
        }
コード例 #2
0
ファイル: CommonTest.cs プロジェクト: leohsu91/DbEntry
        public void TestNoLazy2()
        {
            StaticRecorder.CurRow.Add(new RowInfo("Id", 1L));
            StaticRecorder.CurRow.Add(new RowInfo("No", 2));
            StaticRecorder.CurRow.Add(new RowInfo("Name", "aha"));
            StaticRecorder.CurRow.Add(new RowInfo("Content", "I'm here"));

            var list = Nolazy.Where(Condition.Empty).SelectNoLazy();

            Assert.AreEqual(1, list.Count);
            Assert.AreEqual(2, list[0].No);
            Assert.AreEqual("aha", list[0].Name);
            Assert.AreEqual("I'm here", list[0].Content);
            AssertSql("SELECT [Id],[No],[Name],[Content] AS [$Content] FROM [Nolazy];\n<Text><60>()");
        }