public void the_payload_is_submitted_to_the_eDRS_service()
 {
     _sut.Send(_lrap1Submission);
     A.CallTo(() => _fakeEdrsCommunicator.Submit(A <Lrap1Request>
                                                 .That.Matches(r => r.Payload == _lrap1Submission.Payload)))
     .MustHaveHappened(Repeated.Exactly.Once);
 }
Exemplo n.º 2
0
        public ResponseType Send(SubmitLrap1Command submission)
        {
            if (string.IsNullOrEmpty(submission.ApplicationId))
            {
                throw new ArgumentException("Missing ApplicationId");
            }

            if (string.IsNullOrEmpty(submission.Username))
            {
                throw new ArgumentException("Missing Username");
            }

            if (string.IsNullOrEmpty(submission.Password))
            {
                throw new ArgumentException("Missing Password");
            }

            return(_edrsCommunicator.Submit(new Lrap1Request()
            {
                ApplicationId = submission.ApplicationId,
                Username = submission.Username,
                Password = submission.Password,
                Payload = submission.Payload
            }).ResponseType);
        }
 public void it_is_submitted_to_the_Edrs_attachment_service()
 {
     _sut.Send(_lrap1AttachmentSubmission);
     A.CallTo(() => _fakeEdrsCommunicator.Submit(A <Lrap1AttachmentRequest>
                                                 .That.Matches(r => r.Payload == _lrap1AttachmentSubmission.Payload &&
                                                               r.ApplicationId == _lrap1AttachmentSubmission.ApplicationId)))
     .MustHaveHappened(Repeated.Exactly.Once);
 }