/// <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) { InvalidateBulkRequestCache(); InvalidateMetadataCaches(); foreach (long entityId in entities) { _auditLogEventTarget.WriteDeleteAuditLogEntries(true, entityId, state); } }
public void TestOnDeleteApplication() { bool success = true; string solutionName = "Solution" + Guid.NewGuid(); var mockAuditLog = new Mock <IAuditLog>(MockBehavior.Strict); mockAuditLog.Setup(al => al.OnDeleteApplication(success, solutionName)); var eventTarget = new AuditLogSolutionEventTarget(mockAuditLog.Object); var solution = new Solution { Name = solutionName }; IDictionary <string, object> state = new Dictionary <string, object>(); eventTarget.GatherAuditLogEntityDetailsForDelete(solution, state); eventTarget.WriteDeleteAuditLogEntries(success, solution.Id, state); mockAuditLog.VerifyAll(); }