Example #1
0
        public async Task <IActionResult> Delete(Guid pingbackId, [FromServices] IMoongladeAudit moongladeAudit)
        {
            if (_pingbackService.DeleteReceivedPingback(pingbackId).IsSuccess)
            {
                await moongladeAudit.AddAuditEntry(EventType.Content, AuditEventId.PingbackDeleted,
                                                   $"Pingback '{pingbackId}' deleted.");

                return(Json(pingbackId));
            }
            return(Json(null));
        }
Example #2
0
        public bool TestDeleteReceivedPingback(int deleteReturn)
        {
            _pingbackRepositoryMock.Setup(p => p.Delete(It.IsAny <Guid>())).Returns(deleteReturn);
            var pingbackReceiverMock = new Mock <IPingbackReceiver>();

            var svc = new PingbackService(
                _loggerMock.Object,
                pingbackReceiverMock.Object,
                _pingbackRepositoryMock.Object,
                _postRepositoryMock.Object,
                _notificationMock.Object);

            var response = svc.DeleteReceivedPingback(Guid.NewGuid());

            return(response.IsSuccess);
        }
Example #3
0
 public IActionResult Delete(Guid pingbackId)
 {
     return(_pingbackService.DeleteReceivedPingback(pingbackId).IsSuccess ? Json(pingbackId) : Json(null));
 }