Esempio n. 1
0
        public void Test1()
        {
            SqlRecorder.Start();
            var o = new LeafingEnum {
                Name = "test", Type = 10, Value = null
            };

            DbEntry.Insert(o);
            AssertSql(@"INSERT INTO [Leafing_Enum] ([Type],[Name],[Value]) VALUES (@Type_0,@Name_1,@Value_2);
SELECT LAST_INSERT_ROWID();
<Text><30>(@Type_0=10:Int32,@Name_1=test:String,@Value_2=<NULL>:Int32)", SqlRecorder.LastMessage);
            SqlRecorder.Stop();
        }
Esempio n. 2
0
        public void TestCross()
        {
            ImpPeople.FindById(1);
            SqlRecorder.Start();

            ImpPeople p = ImpPeople.FindById(1);

            p.Save();
            Assert.AreEqual(1, SqlRecorder.List.Count);

            p.Name = "abc";
            p.Save();
            Assert.AreEqual(2, SqlRecorder.List.Count);
            Assert.AreEqual("UPDATE [People] SET [Name]=@Name_0  WHERE [Id] = @Id_1;\n<Text><30>(@Name_0=abc:String,@Id_1=1:Int64)", SqlRecorder.LastMessage);

            SqlRecorder.Stop();
        }
Esempio n. 3
0
        public void Test1()
        {
            SqlRecorder.Start();

            var de = new DataProvider("SQLite");

            var sql = new SqlStatement("test log")
            {
                NeedLog = false
            };

            de.ExecuteNonQuery(sql);

            Assert.AreEqual(0, SqlRecorder.List.Count);

            sql.NeedLog = true;
            de.ExecuteNonQuery(sql);

            Assert.AreEqual(1, SqlRecorder.List.Count);
            Assert.AreEqual("test log<Text><30>()", SqlRecorder.LastMessage);

            SqlRecorder.Stop();
        }