Example #1
0
        public static void InsertInTransaction_Rollback_TypedRow(ICRUDDataStore store)
        {
            var transaction = store.BeginTransaction();

            for (var i = 0; i < 25; i++)
            {
                transaction.Insert(new Patient
                {
                    SSN        = "999-88-9012",
                    First_Name = "Jack",
                    Last_Name  = "Kozloff" + i,
                    DOB        = new DateTime(1980, 1, 12)
                });
            }


            var result = store.Load(new Query("CRUD.Patient.List", typeof(Patient))
            {
                new Query.Param("LN", "%loff%")
            })[0];

            Assert.AreEqual(0, result.Count);

            transaction.Rollback();

            result = store.Load(new Query("CRUD.Patient.List", typeof(Patient))
            {
                new Query.Param("LN", "%loff%")
            })[0];

            Assert.AreEqual(0, result.Count);
        }
Example #2
0
        public static void InsertInTransaction_Rollback_TypedRow(ICRUDDataStore store)
        {
            var transaction = store.BeginTransaction();

            for(var i=0; i<25; i++)
            {
                transaction.Insert( new Patient
                               {
                                 SSN = "999-88-9012",
                                 First_Name = "Jack",
                                 Last_Name = "Kozloff"+i,
                                 DOB = new DateTime(1980, 1, 12)
                               });
            }

            
            var result = store.Load( new Query("CRUD.Patient.List", typeof(Patient) ) { new Query.Param("LN", "%loff%") } )[0];
            
            Assert.AreEqual(0, result.Count);

            transaction.Rollback();

            result = store.Load( new Query("CRUD.Patient.List", typeof(Patient) ) { new Query.Param("LN", "%loff%") } )[0];
            
            Assert.AreEqual(0, result.Count);
        }