dotnet / dotnet/SqlClient

Tests | Additional test cases

Open Beginner friendly
#4,377 0 comments 0 reactions 0 assignees View on GitHub
Area\Tests
Dominant language
C#
Stars
989
Forks
340
Avg merge
4d 19h
Merged PRs (30d)
72

Description

### Summary of all missing cases

| # | Constructor | Input | What to assert |
|---|---|---|---|
| 1 | 1-arg `(string)` | `null` | `ApplicationClientId == SqlClientId`, `UseWamBroker == true` |
| 2 | 2-arg `(callback, string?)` | non-null callback + `SqlClientApplicationId` | `UseWamBroker == true` |
| 3 | 2-arg `(callback, string?)` | `null` callback + custom ID | No throw; `_deviceCodeFlowCallback == DefaultDeviceFlowCallback` |
| 4 | Options ctor | `ApplicationClientId = SqlClientId, UseWamBroker = true` | `UseWamBroker == true` |
| 5 | Any ctor with non-null callback | explicit callback | `_deviceCodeFlowCallback` is that exact instance |
| 6 | Any ctor without callback | omitted/null callback | `_deviceCodeFlowCallback` is `DefaultDeviceFlowCallback`, not null |
| — | Duplicate | `Ctor_ApplicationClientId_EnablesWamBroker` | Remove in favour of `Ctor_AppClientId_SqlClientId_EnablesWamBroker` |

_Originally posted by @paulmedynski in https://github.com/dotnet/SqlClient/pull/4288#discussion_r3435183576_

Contributor guide

Open the contributing guide

Research direction

Locate the constructor tests and the existing Ctor_ApplicationClientId_EnablesWamBroker test. Add coverage for the listed null, custom-ID, callback, options, and default-callback cases, remove the duplicate test, and run the relevant test class. Done means every assertion in the table passes and the duplicate is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.