Skip to content

Conversation

@amikhaildev
Copy link
Contributor

When running AcceptanceTests for error scenarios using Refit, it throws null reference exception. This is caused by refit trying to access response.RequestMessage.Method while response.RequestMessage is null. This change resolves that issue by setting the original request as response.RequestMessage. It will also help if any tested code is accessing response.RequestMessage.

The refit method that throws null reference exception https://github.com/reactiveui/refit/blob/569108a65079d364647f06437f977df8145fc578/Refit/RefitSettings.cs#L233

When running AcceptanceTests for error scenarios using Refit, it throws null reference exception. This is caused by refit trying to access response.RequestMessage.Method while response.RequestMessage is null. 
This change resolves that issue by setting the original request as response.RequestMessage. It will also help if any tested code is accessing response.RequestMessage.

The refit method that throws null reference exception https://github.com/reactiveui/refit/blob/569108a65079d364647f06437f977df8145fc578/Refit/RefitSettings.cs#L233
@AlanCS AlanCS self-requested a review November 21, 2022 08:45
@dknowles
Copy link

Is there any additional information we can provide that would make the review easier?

Copy link
Owner

@AlanCS AlanCS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good improvement, thanks for posting it

@AlanCS AlanCS merged commit 6fe5798 into AlanCS:master Nov 21, 2022
@AlanCS
Copy link
Owner

AlanCS commented Nov 21, 2022

Is there any additional information we can provide that would make the review easier?

no, it was well documented in the first place :)
sorry, I was a bit busy yesterday, and trying to figure out how to make the github action run for this PR, it didn't automatically because it was paused for a while

@AlanCS
Copy link
Owner

AlanCS commented Nov 21, 2022

https://www.nuget.org/packages/SystemTestingTools/2.0.32 is the version with this fix !

just out of curiosity, how is the adoption of component testing instead of unit testing everything at your company ? no need to disclose the company or any details if you don't feel confortable to do so !

@dknowles
Copy link

unit testing is still the most common style of test. stubbed acceptance tests are definitely getting a lot more effort nowadays though :)

@amikhaildev
Copy link
Contributor Author

Thanks @AlanCS for the quick response. Tests are working properly now!
As @dknowles mentioned we are trying to add more stubbed acceptance tests. I find them really helpful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants