public void WhenThereIsNoMatchingRecordReturnsNull() { const int existentCaseNoteId = 123; const int nonexistentCaseNoteId = 456; AddCaseNoteWithNoteTypeAndWorkerToDatabase(id: existentCaseNoteId); var response = _historicalDataGateway.GetCaseNoteById(nonexistentCaseNoteId); response.Should().BeNull(); }
public CaseNoteResponse ExecuteGetById(string id) { long noteId; try { noteId = Convert.ToInt64(id); } catch { throw new CaseNoteIdConversionException($"Note id conversion failed for {id}"); } var caseNote = _historicalDataGateway.GetCaseNoteById(noteId); if (caseNote == null) { throw new CaseNoteNotFoundException(); } return(ResponseFactory.ToResponse(caseNote)); }