예제 #1
0
        public void RemoveOnCommit()
        {
            TransactionalWrapper <int, string> wrapper = new TransactionalWrapper <int, string> {
                { 1, "1" }, { 2, "2" }, { 3, "3" }
            };

            using (var transaction = wrapper.BeginTransaction())
            {
                transaction.Remove(1);
                transaction.Remove(3);

                Assert.IsTrue(wrapper.Count == 3);
            }

            Assert.IsTrue(wrapper.Count == 1);
        }
예제 #2
0
        public void AddOnCommit()
        {
            TransactionalWrapper <int, string> wrapper = new TransactionalWrapper <int, string>();

            using (var transaction = wrapper.BeginTransaction())
            {
                transaction.Add(1, "1");
                transaction.Add(2, "2");
                transaction.Add(3, "3");

                Assert.IsTrue(wrapper.Count == 0);
                Assert.IsTrue(transaction.Count == 3);
            }

            Assert.IsTrue(wrapper.Count == 3);
        }
예제 #3
0
        public void DoNotAddOnRollback()
        {
            TransactionalWrapper <int, string> wrapper = new TransactionalWrapper <int, string>();

            using (var transaction = wrapper.BeginTransaction())
            {
                transaction.Add(1, "1");
                transaction.Add(2, "2");
                transaction.Add(3, "3");

                Assert.IsTrue(transaction.Count == 3);

                wrapper.RollbackTransation(transaction);
            }

            Assert.IsTrue(wrapper.Count == 0);
        }
예제 #4
0
        public void DoNotRemoveOnRollback()
        {
            TransactionalWrapper <int, string> wrapper = new TransactionalWrapper <int, string> {
                { 1, "1" }, { 2, "2" }, { 3, "3" }
            };

            using (var transaction = wrapper.BeginTransaction())
            {
                transaction.Remove(1);
                transaction.Remove(3);

                Assert.IsTrue(transaction.Count == 1);

                wrapper.RollbackTransation(transaction);
            }
            Assert.IsTrue(wrapper.Count == 3);
        }
예제 #5
0
        public void IncompatibleAddAndRemove()
        {
            TransactionalWrapper <int, string> wrapper = new TransactionalWrapper <int, string> {
                { 1, "1" }, { 2, "2" }, { 3, "3" }
            };

            using (Transaction <int, string> transaction = wrapper.BeginTransaction())
            {
                transaction.Remove(2);
                Assert.IsTrue(transaction.Count == 2);

                transaction.Add(2, "2");
                Assert.IsTrue(transaction.Count == 3);
            }

            Assert.IsTrue(wrapper.Count == 3);
        }
예제 #6
0
        public void TwoTransactions()
        {
            TransactionalWrapper <int, string> wrapper = new TransactionalWrapper <int, string> {
                { 1, "1" }, { 2, "2" }, { 3, "3" }
            };

            using (Transaction <int, string> firstTransaction = wrapper.BeginTransaction())
            {
                using (Transaction <int, string> secondTransaction = wrapper.BeginTransaction())
                {
                    secondTransaction.Remove(2);
                    secondTransaction.Remove(3);
                }

                Assert.IsTrue(wrapper.Count == 1);

                firstTransaction.Add(2, "2");
                firstTransaction.Add(3, "3");
            }

            Assert.IsTrue(wrapper.Count == 3);
        }
예제 #7
0
 public BaseRepository(TransactionalWrapper conexion)
 {
     _conexionWrapper = conexion;
 }
예제 #8
0
 public SkillRepository(TransactionalWrapper conexion) : base(conexion)
 {
 }
 public WorkProjectRepository(TransactionalWrapper conexion) : base(conexion)
 {
 }
 public PersonalProfileRepository(TransactionalWrapper conexion) : base(conexion)
 {
 }
 public WorkExpereinceRepository(TransactionalWrapper conexion) : base(conexion)
 {
 }
 public InterestsRepository(TransactionalWrapper conexion) : base(conexion)
 {
 }
예제 #13
0
 public OrderRepository(TransactionalWrapper connection)
     : base(connection)
 {
 }
예제 #14
0
 public AcademicProjectRepository(TransactionalWrapper conexion) : base(conexion)
 {
 }
예제 #15
0
 public ProductRepository(TransactionalWrapper connection) : base(connection)
 {
 }
예제 #16
0
 public DeliveryRepository(TransactionalWrapper connection)
     : base(connection)
 {
 }
예제 #17
0
 public RepositoryBase(TransactionalWrapper connection)
 {
     _connectionnWrapper = connection;
 }
예제 #18
0
 public UserIdRepository(TransactionalWrapper conexion) : base(conexion)
 {
 }
 public EducationRespository(TransactionalWrapper conexion) : base(conexion)
 {
 }