Unit Testing: How to bypass RunPage Deserializer? #296
Labels
hacktoberfest
Issues for participation in Hacktoberfest
Status: Up for grabs
Issues that are ready to be worked on by anyone
Type: Support
Any questions, information, or general needs around the SDK or GitHub APIs
Describe the need
I am unable to unit test when working with the Run< T > IConnection extension. I am injecting a custom HTTPClient into the connection class but it seems the deserialization process called from IRunner.RunPage in the SimpleQuery class, expects a specific format that is outside of the purposes of testing as I only want the result set obtained from the RunPage task.
The hard coded value in the httpclient is what the deserialize expects, not what it will output after deseralization.
How can I bypass this step?
or
What can I do to input custom data that will match the result?
public async Task RunPage(CancellationToken cancellationToken = default)
{
var deserializer = new ResponseDeserializer();
var data = await connection.Run(parent.GetPayload(variables), cancellationToken).ConfigureAwait(false);
Result = deserializer.Deserialize(parent.ResultBuilder, data); //<---- BYPASS THIS
return false;
}
The text was updated successfully, but these errors were encountered: