Esempio n. 1
0
        public void ShouldReturnPlanFromEmployee()
        {
            using(var s = OpenSession())
            using (var trans = s.BeginTransaction())
            {
                var plan = new _401k {PlanName = "test"};
                s.Save(plan);
                s.Refresh(plan);
                var emp = new Employee {EmpName = "name", PlanParent = plan};
                s.Save(emp);

                trans.Rollback();
            }
        }
Esempio n. 2
0
        public void ShouldReturnPlanFromEmployee()
        {
            using (var s = OpenSession())
                using (var trans = s.BeginTransaction())
                {
                    var plan = new _401k {
                        PlanName = "test"
                    };
                    s.Save(plan);
                    s.Refresh(plan);
                    var emp = new Employee {
                        EmpName = "name", PlanParent = plan
                    };
                    s.Save(emp);

                    trans.Rollback();
                }
        }
Esempio n. 3
0
        public async Task ShouldReturnPlanFromEmployeeAsync()
        {
            using (var s = OpenSession())
                using (var trans = s.BeginTransaction())
                {
                    var plan = new _401k {
                        PlanName = "test"
                    };
                    await(s.SaveAsync(plan));
                    await(s.FlushAsync());
                    await(s.RefreshAsync(plan));
                    var emp = new Employee {
                        EmpName = "name", PlanParent = plan
                    };
                    await(s.SaveAsync(emp));

                    await(trans.RollbackAsync());
                }
        }