예제 #1
0
        public void SetResult_FirstAcceptThenReject_ClearsAcceptedTransferSyntax()
        {
            var context = new DicomPresentationContext(0x07, DicomUID.CTImageStorage);

            context.SetResult(DicomPresentationContextResult.Accept, DicomTransferSyntax.JPEGProcess1);
            context.SetResult(DicomPresentationContextResult.RejectTransferSyntaxesNotSupported);

            Assert.Null(context.AcceptedTransferSyntax);
        }
예제 #2
0
        public void SetResult_TwoArgumentNotAcceptTransferSyntaxNull_DoesNotThrow()
        {
            var context   = new DicomPresentationContext(0x03, DicomUID.RTPlanStorage);
            var exception = Record.Exception(() => context.SetResult(DicomPresentationContextResult.RejectAbstractSyntaxNotSupported, null));

            Assert.Null(exception);
        }
예제 #3
0
        public void SetResult_TwoArgumentAcceptTransferSyntaxNull_Throws()
        {
            var context   = new DicomPresentationContext(0x03, DicomUID.RTPlanStorage);
            var exception = Record.Exception(() => context.SetResult(DicomPresentationContextResult.Accept, null));

            Assert.IsType <DicomNetworkException>(exception);
        }
예제 #4
0
        public void SetResult_OneArgumentNotAcceptNoTransferSyntax_DoesNotThrow()
        {
            var context   = new DicomPresentationContext(0x03, DicomUID.RTPlanStorage);
            var exception = Record.Exception(() => context.SetResult(DicomPresentationContextResult.RejectNoReason));

            Assert.Null(exception);
        }
예제 #5
0
        public void SetResult_TwoArguments_AcceptedTransferSyntaxOnlyRequiredOnAcceptNullOtherwise(
            DicomPresentationContextResult result,
            DicomTransferSyntax acceptedSyntax)
        {
            var context = new DicomPresentationContext(0x01, DicomUID.Verification);

            context.SetResult(result, acceptedSyntax);

            Assert.Equal(result == DicomPresentationContextResult.Accept ? acceptedSyntax : null,
                         context.AcceptedTransferSyntax);
        }