I have overridden the default NHibernate DefaultDeleteEventListener according to this source: http://nhforge.org/blogs/nhibernate/archive/2008/09/06/soft-deletes.aspx
so I have
protected override void DeleteEntity(
IEventSource session,
object entity,
EntityEntry entityEntry,
bool isCascadeDeleteEnabled,
IEntityPersister persister,
ISet transientEntities)
{
if (entity is ISoftDeletable)
{
var e = (ISoftDeletable)entity;
e.DateDeleted = DateTime.Now;
CascadeBeforeDelete(session, persister, entity, entityEntry, transientEntities);
CascadeAfterDelete(session, persister, entity, transientEntities);
}
else
{
base.DeleteEntity(session, entity, entityEntry, isCascadeDeleteEnabled, persister, transientEntities);
}
}
How can I test only this piece of code, without configuring an NHIbernate Session?