Exemple #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.Queries.Patient.List", typeof(Patient))
            {
                new Query.Param("LN", "%loff%")
            })[0];

            Aver.AreEqual(0, result.Count);

            transaction.Rollback();

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

            Aver.AreEqual(0, result.Count);
        }