Exemple #1
0
        public static void Delete_Removes_EntityOnKeyWithSessionGeneric()
        {
            var repo     = new BraveRepository(Factory);
            var result   = false;
            var expected = new Brave {
                NewId = 2
            };
            Brave resultBrave = new Brave();

            Assert.DoesNotThrow(() =>
            {
                repo.SaveOrUpdate <ITestSession>(expected);
                result      = repo.Delete <ITestSession>(expected);
                resultBrave = repo.Get <ITestSession>(expected);
            }
                                );
            Assert.That(result, Is.True);
            Assert.That(resultBrave, Is.Null);
        }
Exemple #2
0
        public static void Delete_Removes_EntityOnKey()
        {
            var repo     = new BraveRepository(Factory);
            var result   = false;
            var expected = new Brave {
                Id = 1
            };
            Brave resultBrave = new Brave();

            Assert.DoesNotThrow(() =>
            {
                using (var uow = Connection.UnitOfWork(IsolationLevel.Serializable))
                {
                    result      = repo.Delete(expected, uow);
                    resultBrave = repo.Get(expected, uow);
                    uow.Rollback();
                }
            }
                                );
            Assert.That(result, Is.True);
            Assert.That(resultBrave, Is.Null);
        }