public void WhenThereIsNoMatchingRecordReturnsNull()
        {
            const int existentCaseNoteId    = 123;
            const int nonexistentCaseNoteId = 456;

            AddCaseNoteWithNoteTypeAndWorkerToDatabase(id: existentCaseNoteId);

            var response = _historicalDataGateway.GetCaseNoteById(nonexistentCaseNoteId);

            response.Should().BeNull();
        }
示例#2
0
        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));
        }