Skip to content

How to work with request for query string odata #25

@paulinhps

Description

@paulinhps

Hello, I'm not able to make the mock when the query string is about odata. For example:

_mockHttp.When(matching => matching
                .RequestUri("*/Invoices")
                .QueryString($"?$filter=(NumAtCard eq '{validNumAtCard}')")
                .Method(HttpMethod.Get)
                .WithoutContent()
            )
                .Respond(HttpStatusCode.OK, JsonSerializer.Serialize(new SapQueryResult<InvoiceDataModel>
                {
                    Value = new[]
                    {
                        expectedInvoice
                    }
                }), "application/json")
                .Verifiable();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions