Exemplo n.º 1
0
        public async Task Monitor_DocuSign_Run_TemplateValue()
        {
            var envelopeId = Guid.NewGuid().ToString();

            var configureUrl = GetTerminalConfigureUrl();
            var runUrl       = GetTerminalRunUrl();

            var activityDTO = await GetActivityDTO_WithTemplateValue();

            var authToken = await HealthMonitor_FixtureData.DocuSign_AuthToken(this);

            activityDTO.Item1.AuthToken = authToken;

            var dataDTO = new Fr8DataDTO {
                ActivityDTO = activityDTO.Item1
            };
            var preparedActionDTO = await HttpPostAsync <Fr8DataDTO, ActivityDTO>(configureUrl, dataDTO);

            dataDTO.ActivityDTO = preparedActionDTO;
            AddOperationalStateCrate(dataDTO, new OperationalStateCM());

            AddPayloadCrate(
                dataDTO,
                new EventReportCM
            {
                EventPayload = HealthMonitor_FixtureData.GetEnvelopePayload()
            }
                );

            preparedActionDTO.AuthToken = authToken;

            var responsePayloadDTO = await HttpPostAsync <Fr8DataDTO, PayloadDTO>(runUrl, dataDTO);

            var crateStorage    = Crate.GetStorage(responsePayloadDTO);
            var docuSignPayload = crateStorage.CrateContentsOfType <StandardPayloadDataCM>(x => x.Label == "DocuSign Envelope Fields").SingleOrDefault();

            Assert.IsNotNull(docuSignPayload, "Crate with DocuSign envelope fields was not found in payload");
            Assert.AreEqual(16, docuSignPayload.AllValues().Count(), "DocuSign envelope fields count doesn't match expected value");
        }