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 SubmitLrap1Result Send(SubmitLrap1Command command)
 {
     _bus.Send(command);
     return  new SubmitLrap1Result()
     {
         Command = command
     };
 }
        public void the_submission_service_processes_the_message()
        {
            //Arrange
            var command = new SubmitLrap1Command()
            {
                ApplicationId = "1234567890",
                Username = "******",
                Password = "******",
                Payload = "payload"
            };

            var fakeMessageProcessor = A.Fake<IMessageProcessor>();
            var sut = A.Fake<Lrap1Processor>();
            sut.MessageProcessor = fakeMessageProcessor;

            //Act
            sut.Handle(command);

            //Assert
            A.CallTo(() => fakeMessageProcessor.Process(command))
                .MustHaveHappened(Repeated.Exactly.Once);
        }
        public When_the_messaging_service_processes_an_LRAP1_submission()
        {
            //Arrange
            _fakeCommsService = A.Fake<ICommsService>();
            _fakeMessageSender = A.Fake<ISendMessages>();

            _sut = new Lrap1Processor(_fakeMessageSender, _fakeCommsService);

            _command = new SubmitLrap1Command()
            {
                ApplicationId = "123456789",
                Username = "******",
                Password = "******",
                Payload = "Payload"
            };
        }
 public When_a_Lrap1_is_sent()
 {
     _fakeEdrsCommunicator = A.Fake<IEdrsCommunicator>();
     _sut = new CommsService(_fakeEdrsCommunicator);
     _lrap1Submission = new SubmitLrap1Command()
     {
         ApplicationId = "1234567890",
         Username = "******",
         Password = "******",
         Payload = "Lrap1 Payload Data"
     };
 }