- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.6k
 
          [dotnet] Add not-null Response.Value helper
          #15243
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
  
    [dotnet] Add not-null Response.Value helper
  
  #15243
              Conversation
          PR Reviewer Guide 🔍Here are some key observations to aid the review process: 
  | 
    
          PR Code Suggestions ✨Explore these optional code suggestions: 
  | 
    
| 
           Test failures are unrelated to this PR //java/test/org/openqa/selenium/mobile:NetworkConnectionTest
//java/test/org/openqa/selenium/remote:RemoteWebDriverScreenshotTest
//java/test/org/openqa/selenium/remote:RemoteWebDriverScreenshotTest-firefox-beta
//rb/spec/integration/selenium/webdriver:network-firefox-beta-bidi
//rb/spec/integration/selenium/webdriver:network-firefox-bidi | 
    
* [dotnet] Add not-null `Response.Value` helper * Use other style * update method name * add custom error message * EnsureValueIsNotNull can return itself * Improve message * Improve message
* [dotnet] Add not-null `Response.Value` helper * Use other style * update method name * add custom error message * EnsureValueIsNotNull can return itself * Improve message * Improve message
User description
Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Add not-null
Response.ValuehelperMotivation and Context
DRY-ing up future null checks on
Response.ValueTypes of changes
Checklist
PR Type
Enhancement
Description
Added a helper method
GetNotNullValueinResponseclass.Ensures
Response.Valueis not null, throws exception otherwise.Improves code reliability by centralizing null checks.
Changes walkthrough 📝
Response.cs
Add `GetNotNullValue` method to `Response` classdotnet/src/webdriver/Response.cs
GetNotNullValuemethod to handle null checks forResponse.Value.WebDriverExceptionifValueis null.