Skip to content
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

Missing unit tests coverage of public methods in Design namespace #10773

Open
SimonZhao888 opened this issue Jan 31, 2024 · 4 comments
Open

Missing unit tests coverage of public methods in Design namespace #10773

SimonZhao888 opened this issue Jan 31, 2024 · 4 comments
Assignees
Labels
🚧 work in progress Work that is current in progress help wanted Good issue for external contributors test-enhancement Improvements of test source code
Milestone

Comments

@SimonZhao888
Copy link
Member

SimonZhao888 commented Jan 31, 2024

We are in the process of adding unit tests for all public methods to improve the test coverage of code. Here is a list categorized by namespace.

System.Windows.Forms.Design

@SimonZhao888 SimonZhao888 added the test-enhancement Improvements of test source code label Jan 31, 2024
@ricardobossan
Copy link
Member

ricardobossan commented Jan 31, 2024

There's also this previous list of controls, that were added on #10453 :

image

@Tanya-Solyanik
Copy link
Member

Tanya-Solyanik commented Jan 31, 2024

@SimonZhao888 - could you please use this bug only for public classes from System.Windows.Forms.Design namespace - https://github.com/dotnet/winforms/tree/main/src/System.Windows.Forms.Design/src? And then add help-wanted label. We will use this bug to track tests added by contributors.

@Tanya-Solyanik Tanya-Solyanik added this to the Future milestone Jan 31, 2024
@Tanya-Solyanik Tanya-Solyanik changed the title Missing unit tests coverage in Windows Forms runtime Missing unit tests coverage of public methods in Design namespace Jan 31, 2024
@sharwell
Copy link
Member

sharwell commented Jan 31, 2024

Also remember the goal here isn't to increase code coverage. The goal is to identify user/developer scenarios which people are depending on today, and add tests that make it unlikely we would break those users in the future. Every added test should be written from the perspective of what someone using WinForms will try to do, and validate they will get the expected result.

The difference is subtle for public APIs, but for internal APIs that aren't always obvious to invoke, it becomes important to try and write tests targeting those features against public APIs where possible. Tests that exercise behavior using public APIs better reflect user behavior and the tests are much easier to understand if a failure ever shows up.

@SimonZhao888 SimonZhao888 added the help wanted Good issue for external contributors label Feb 1, 2024
@ghost ghost modified the milestones: Future, Help wanted Feb 1, 2024
@ghost
Copy link

ghost commented Feb 1, 2024

This issue is now marked as "help wanted", and we’re looking for a community volunteer to work on this issue. If we receive no interest in 180 days, we will close the issue. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@LeafShi1 LeafShi1 modified the milestones: Help wanted, .NET 9.0 Jul 17, 2024
@dotnet-policy-service dotnet-policy-service bot added the 🚧 work in progress Work that is current in progress label Jul 17, 2024
@Tanya-Solyanik Tanya-Solyanik removed this from the .NET 9.0 milestone Jul 23, 2024
Tanya-Solyanik pushed a commit that referenced this issue Sep 13, 2024
Related #10773

Add unit test PanelDesignerTests.cs for public properties and method of the PanelDesigner.cs
Enable nullability in PanelDesignerTests.cs
Tanya-Solyanik pushed a commit that referenced this issue Sep 14, 2024
Related #10773

Proposed changes
Add unit test file: TabPageDesignerTests.cs for public properties of the TabPageDesigner.cs.
Enable nullability in TabPageDesignerTests.cs.
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 17, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage for `RichTextBoxActionList`
- Coverage for the `EditLines()` method could not be added. The
dependent method `EditorServiceContext.EditValue(_designer, Component!,
"Lines")` is static and could not be mocked, and the dialog that opens
during its execution requires manual intervention to close.

## Customer Impact

- None or succinct description

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-preview.7.24407.12
Tanya-Solyanik pushed a commit that referenced this issue Sep 18, 2024
Add code coverage to RichTextBoxActionList

Related to #10773

## Proposed changes

- Adds code coverage for `RichTextBoxActionList`
- Coverage for the `EditLines()` method could not be added. The
dependent method `EditorServiceContext.EditValue(_designer, Component!,
"Lines")` is static and could not be mocked, and the dialog that opens
during its execution requires manual intervention to close.


Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) <v-rbossan@microsoft.com>
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 18, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage to `FormatControl`.

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
lonitra pushed a commit that referenced this issue Sep 18, 2024
Related #10773

## Proposed changes

- Adds code coverage to `FormatControl`.

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12

Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) <v-rbossan@microsoft.com>
Tanya-Solyanik pushed a commit that referenced this issue Sep 19, 2024
Related #10773

Proposed changes
Add unit test file: TabControlDesignerTests.cs for public properties and methods of the TabControlDesigner.cs.
Enable nullability in TabControlDesignerTests.cs.
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 19, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage for `FormatStringDialog`.

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
Tanya-Solyanik pushed a commit that referenced this issue Sep 20, 2024
Related #10773

Proposed changes
Add unit test ControlDesigner.DesignerControlCollectionTests.cs for public properties and method of the ControlDesigner.DesignerControlCollection.
Enable nullability in ControlDesigner.DesignerControlCollection.
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 23, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage for `FormatStringDialog`.

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
Tanya-Solyanik pushed a commit that referenced this issue Sep 23, 2024
Related #10773

Add unit test TextBoxActionListTests.cs for public properties and method of the TextBoxActionList.
Enable nullability in TextBoxActionList.
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 24, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage for `FormatStringDialog`.

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 24, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage for `FormatStringDialog`.

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 25, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage to `FormatStringEditor`

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 25, 2024
…ll methods use them

Related dotnet#10773

## Proposed changes

- Adds code coverage to `FormatStringEditor`

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
lonitra pushed a commit that referenced this issue Sep 25, 2024
Adds code coverage for FormatStringDialog

Related #10773

## Proposed changes

- Adds code coverage for `FormatStringDialog`.

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12

Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) <v-rbossan@microsoft.com>
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 25, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage to `FormatStringEditor`

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 30, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage to `FormatStringEditor`

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
ricardobossan pushed a commit to ricardobossan/winforms that referenced this issue Sep 30, 2024
Related dotnet#10773

## Proposed changes

- Adds code coverage to `FormatStringEditor`

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12
lonitra pushed a commit that referenced this issue Sep 30, 2024
Adds coverage to FormatStringEditor

Related #10773

## Proposed changes

- Adds code coverage to `FormatStringEditor`

## Customer Impact

- None

## Regression?

- No

## Risk

- Minimal

## Test methodology

- Unit tests

## Test environment(s)

- 9.0.100-rc.1.24452.12

Co-authored-by: Ricardo Bossan (BEYONDSOFT CONSULTING INC) (from Dev Box) <v-rbossan@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 work in progress Work that is current in progress help wanted Good issue for external contributors test-enhancement Improvements of test source code
Projects
None yet
Development

No branches or pull requests

6 participants