Exemplo n.º 1
0
        public virtual void TestAddRemove()
        {
            var name = TestSupport.RandomString();

            list = Client.GetList <object>(name);
            list.Add("item1");
            ITransactionContext context = Client.NewTransactionContext();

            context.BeginTransaction();
            ITransactionalList <object> listTx = context.GetList <object>(name);

            Assert.IsTrue(listTx.Add("item2"));
            Assert.AreEqual(2, listTx.Size());
            Assert.AreEqual(1, list.Count);
            Assert.IsFalse(listTx.Remove("item3"));
            Assert.IsTrue(listTx.Remove("item1"));
            context.CommitTransaction();
            Assert.AreEqual(1, list.Count);
            listTx.Destroy();
        }