Comments (3)
I'm not sure if I'm following. Any value set explcitly on HttpTest.Settings should always override the same setting set anywhere in the SUT. That's by design. But when not explicitly set on HttpTest.Settings, it should respect the settings specified in the SUT. In your code above, I confirmed that the settings specified at the start are in effect when you make the call further down. Am I missing something?
from flurl.
I've updated the title to hopefully help clarify.
When I run this test, the call ".WithRequestJson(requestDto)" fails. Reason being is the json serializer set on the FlurlClientCache is using camel case. Hence, the serialized json used in the body of the call is {"property":"Value"}. In the call to WithRequestJson, the serializer used to serialize requestDto is not the same as what is set earlier. As a result, WithRequestJson is using pascal case, and is comparing {"Property":"Value"} to the body of the call. Note the uppercase "Property" vs lowercase "property".
{"Property":"Value"} is not the same as {"property":"Value"}
Assertion message:
Flurl.Http.Testing.HttpTestException: Expected any calls to be made with URL pattern http://test.com and body {"Property":"Value"}, but no matching calls were made.
Stack Trace:β
HttpCallAssertion.Assert(Nullable1 count) HttpCallAssertion.With(Func
2 match, String descrip)
HttpCallAssertion.WithRequestBody(String bodyPattern)
HttpCallAssertion.WithRequestJson(Object body)
FlurlTests.TheTest()βlineβ36
from flurl.
Got it. I probably should have ran your test before replying. :) Sounds legitimate, it's been added to the backlog and I'll look into when I get some time.
from flurl.
Related Issues (20)
- Deadlock (or something weird) when calling `GetStringAsync` HOT 2
- 4.0.0 HOT 2
- System.EntryPointNotFoundException on PostJsonAsync HOT 1
- Add support for CancellationToken in IFlurlResponse asynchronous methods HOT 1
- Add option to disable conversion of plus signs to spaces for query parameters HOT 3
- According to RFC-7578 the Content-Disposition filename* parameter in multipart MUST NOT be used
- IFlurlClientBuilder.AddMiddleware cuts the chain of delegating handlers HOT 1
- Encode Issue HOT 2
- .net 8 blazor wasm PlatformNotSupportedException HOT 7
- GetJsonAsync<T> is not working after upgrading the Flurl Http to version 4 >= HOT 5
- The response ended prematurely HOT 2
- Trimming unused code causes the exception - Response could not be deserialized to JSON HOT 4
- Not able to configure Delegating handler in Flurl clientless DI configuration HOT 2
- Collection was modified; enumeration operation may not execute. HOT 1
- DownloadFileAsync => GetFileNameFromPath does not respect redirects HOT 1
- `OnRedirect` does not work with custom `HttpClient` HOT 4
- Serialization based on response status code HOT 1
- Support for Setting HttpRequestMessage.HttpVersionPolicy in FlurlHttpSettings
- SetQueryParam() parameters with the same name will be overwritten, either not overwritten or optionally overwritten HOT 3
- [feature request] support GetJsonAsync with body HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flurl.