Exemplo n.º 1
0
        public void TestImpedHasOne()
        {
            ImpPeople p = ImpPeople.FindById(1);

            Assert.AreEqual("Tom", p.Name);
            Assert.IsNull(p.pc);

            p = ImpPeople.FindById(2);
            Assert.AreEqual("Jerry", p.Name);
            Assert.AreEqual("IBM", p.pc.Name);

            p = ImpPeople.FindById(3);
            Assert.AreEqual("Mike", p.Name);
            Assert.AreEqual("DELL", p.pc.Name);
        }
Exemplo 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();
        }