public static void DeleteKey_Removes_EntityOnKeyWithSessionGeneric() { var repo = new BraveRepository(Factory); var result = false; var expected = new Brave { NewId = 2 }; var resultBrave = new Brave(); Assert.DoesNotThrow(() => { repo.SaveOrUpdate <ITestSession>(expected); result = repo.DeleteKey <ITestSession>(expected.Id); resultBrave = repo.Get <ITestSession>(expected); }); Assert.That(result, Is.True); Assert.That(resultBrave, Is.Null); }
public static void DeleteKey_Removes_EntityOnKey() { var repo = new BraveRepository(Factory); var result = false; var expected = 2; var resultBrave = new Brave(); Assert.DoesNotThrow(() => { using (var uow = Connection.UnitOfWork(IsolationLevel.Serializable)) { result = repo.DeleteKey(expected, uow); resultBrave = repo.GetKey(expected, uow); uow.Rollback(); } } ); Assert.That(result, Is.True); Assert.That(resultBrave, Is.Null); }