public async Task OnNEventReportRequestAsync_ShouldRespond() { var port = Ports.GetNext(); using (DicomServer.Create <AsyncDicomNServiceProvider>(port, logger: _logger.IncludePrefix("DicomServer"))) { var client = new Network.Client.DicomClient("127.0.0.1", port, false, "SCU", "ANY-SCP") { Logger = _logger.IncludePrefix(typeof(DicomClient).Name) }; DicomNEventReportResponse response = null; DicomRequest.OnTimeoutEventArgs timeout = null; var request = new DicomNEventReportRequest( DicomUID.BasicFilmSession, new DicomUID("1.2.3", null, DicomUidType.SOPInstance), 1) { OnResponseReceived = (req, res) => response = res, OnTimeout = (sender, args) => timeout = args }; await client.AddRequestAsync(request).ConfigureAwait(false); await client.SendAsync().ConfigureAwait(false); Assert.NotNull(response); Assert.Equal(DicomStatus.Success, response.Status); Assert.Null(timeout); } }
public void SOPInstanceUIDGetter_ResponseCreatedFromRequest_DoesNotThrow() { var request = new DicomNEventReportRequest( DicomUID.BasicFilmSessionSOPClass, new DicomUID("1.2.3", null, DicomUidType.SOPInstance), 1); var response = new DicomNEventReportResponse(request, DicomStatus.Success); var exception = Record.Exception(() => response.SOPInstanceUID); Assert.Null(exception); }