Description
The Person mock class used in all POST/PUT/PATCH tests declares its properties as private, so JsonConvert.SerializeObject(person) produces {} instead of a real payload. Every test that calls a write-method overload is silently sending an empty body.
Affected File
src/HttpClientServiceHelper.Tests/Mock/Person.cs
// Current — private properties are invisible to Newtonsoft.Json by default
private string FirstName { get; set; }
private string LastName { get; set; }
private string FullName => $"{FirstName} {LastName}";
// Fix — make them public
public string FirstName { get; set; }
public string LastName { get; set; }
Impact
Tests pass because they only assert NotNull and type — they never verify the request body. This masks the fact that POST/PUT/PATCH requests carry an empty payload in the test suite.
Description
The
Personmock class used in all POST/PUT/PATCH tests declares its properties asprivate, soJsonConvert.SerializeObject(person)produces{}instead of a real payload. Every test that calls a write-method overload is silently sending an empty body.Affected File
src/HttpClientServiceHelper.Tests/Mock/Person.cs
Impact
Tests pass because they only assert
NotNulland type — they never verify the request body. This masks the fact that POST/PUT/PATCH requests carry an empty payload in the test suite.