public void Should_delete_summary_by_id_from_repository() { // Arrange var summaryId = 0; var expected = _summaryService.Get(summaryId); // Act var result = _summaryService.Delete(summaryId); // Assert Assert.That(result.Equals(expected)); Assert.Throws <ArgumentException>(() => _summaryRepository.Get(summaryId)); }
public ActionResult <SummaryDto> Delete([FromHeader] Guid token, Int32 summaryId) { try { Int32 currentUserId = ValidateToken(token); return(Ok(_summaryService.Delete(summaryId))); } catch (AuthenticationException) { return(Unauthorized()); } catch (ArgumentException e) { return(BadRequest()); } }