public void Converts_direct_job_successfully_with_polling_queue_successfully()
            {
                var document        = DomainUtility.GetDirectDocument();
                var signer          = DomainUtility.GetSigner();
                var reference       = "reference";
                var exitUrls        = DomainUtility.GetExitUrls();
                var statusretrieval = statusretrievalmethod.WAIT_FOR_CALLBACK;
                var pollingQueue    = new PollingQueue("CustomPollingQueue");
                var sender          = new Sender(BringPublicOrganizationNumber, pollingQueue);

                var source = new Job(
                    document,
                    signer,
                    reference,
                    exitUrls,
                    sender);

                var expected = new directsignaturejobrequest
                {
                    reference = reference,
                    exiturls  = new exiturls
                    {
                        completionurl = source.ExitUrls.CompletionUrl.AbsoluteUri,
                        rejectionurl  = source.ExitUrls.RejectionUrl.AbsoluteUri,
                        errorurl      = source.ExitUrls.ErrorUrl.AbsoluteUri
                    },
                    statusretrievalmethod          = statusretrieval,
                    statusretrievalmethodSpecified = true,
                    pollingqueue = pollingQueue.Name
                };

                //Act
                var result = DataTransferObjectConverter.ToDataTransferObject(source);

                //Assert
                var comparator = new Comparator();
                IEnumerable <IDifference> differences;

                comparator.AreEqual(expected, result, out differences);
                Assert.Empty(differences);
            }
Beispiel #2
0
 public Sender(string organizationNumber, PollingQueue pollingQueue)
 {
     OrganizationNumber = organizationNumber;
     PollingQueue       = pollingQueue;
 }