/// <summary> /// Called after deletion of the specified enumeration of entities has taken place. /// </summary> /// <param name="entities">The entities.</param> /// <param name="state">The state passed between the before delete and after delete callbacks.</param> public void OnAfterDelete(IEnumerable <long> entities, IDictionary <string, object> state) { foreach (long entityId in entities) { _auditLogEventTarget.WriteDeleteAuditLogEntries(true, entityId, state); } }
public void TestOnDeleteTenant() { bool success = true; string tenantName = "Tenant" + Guid.NewGuid(); var mockAuditLog = new Mock <IAuditLog>(MockBehavior.Strict); mockAuditLog.Setup(al => al.OnDeleteTenant(success, tenantName)); var eventTarget = new AuditLogTenantEventTarget(mockAuditLog.Object); var tenant = new Tenant { Name = tenantName }; IDictionary <string, object> state = new Dictionary <string, object>(); eventTarget.GatherAuditLogEntityDetailsForDelete(tenant, state); eventTarget.WriteDeleteAuditLogEntries(success, tenant.Id, state); mockAuditLog.VerifyAll(); }