Exemplo n.º 1
0
        public async Task ZendeskTicketMappedToEventWrapperPassesValidation(EventWrapper wrapper)
        {
            // Given
            var spy = new HttpMessageHandlerSpy();
            var api = new RestClient(new HttpClient(spy)).CreateApi();

            // When
            await api.EscalateTicket(wrapper);

            // Then
            spy.Requests.Should()
            .Contain(x => x.RequestUri.ToString().Contains("/ticket/")).Which
            .Should().HavePayloadValidatedBy(MiddlewareSchema);
        }
Exemplo n.º 2
0
        public async Task FullyGeneratedEventWrapperPassesValidation(EventWrapper wrapper)
        {
            wrapper.Ticket.Organization.OrganizationFields.OrganisationStatus = "active";
            wrapper.Ticket.Organization.OrganizationFields.OrganisationType   = "";
            wrapper.Ticket.Requester.UserFields.ContactType = "";
            wrapper.Ticket.Via = "Web Form";

            // Given
            var handler = new HttpMessageHandlerSpy();
            var api     = new RestClient(new HttpClient(handler)).CreateApi();

            // When
            await api.EscalateTicket(wrapper);

            // Then
            handler.Requests.Should()
            .Contain(x => x.RequestUri.ToString().Contains("/ticket/")).Which
            .Should().HavePayloadValidatedBy(MiddlewareSchema);
        }