Exemplo n.º 1
0
        public void AddRangeTest()
        {
            List<N_Order_Base> list = new List<N_Order_Base>();
            N_Order_Base order1 = new N_Order_Base();
            N_Order_Base order2 = new N_Order_Base();

            list.Add(this.debug.PadValue(order1));
            list.Add(this.debug.PadValue(order2));
            int ret = this.persistence.AddRange(list);
            Assert.AreEqual(2, ret);
        }
Exemplo n.º 2
0
        public void RemoveTest()
        {
            N_Order_Base order = new N_Order_Base();
            int ret = 0;
            //order = null;
            //ret = persistence.Remove<N_Order_Base>(order);
            //Assert.AreEqual(1, ret);

            object param = new { ID = 1, Name = "test" };
            ret = persistence.Remove<N_Order_Base>(null, param);
            Assert.AreEqual(1, ret);
        }
Exemplo n.º 3
0
        public void AddRangeWithTransactionTest()
        {
            List<N_Order_Base> list = new List<N_Order_Base>();
            N_Order_Base order1 = new N_Order_Base();
            N_Order_Base order2 = new N_Order_Base();

            // 不新增,直接返回
            list.Add(order1);
            list.Add(this.debug.PadValue(order2));
            int ret = this.persistence.AddRange(list,true);
            Assert.AreEqual(0, ret);

            // 此时会先新增再删除,此时自增ID会出现不连续的情况
            list.Clear();
            list.Add(this.debug.PadValue(order2));
            list.Add(order1);
            ret = this.persistence.AddRange(list, true);
            Assert.AreEqual(0, ret);
        }
Exemplo n.º 4
0
 public void AddTest()
 {
     N_Order_Base order = new N_Order_Base();
     order = this.debug.PadValue(order);
     int ret = this.persistence.Add(order);
     Assert.AreEqual(1, ret);
 }