Skip to content

Conversation

@Zheng-Li01
Copy link
Member

@Zheng-Li01 Zheng-Li01 commented Mar 12, 2025

Related #10773

Proposed changes

Add unit test DataSourceListEditorTests.cs for public method of the DataSourceListEditor.

Microsoft Reviewers: Open in CodeFlow

@Zheng-Li01 Zheng-Li01 requested a review from a team as a code owner March 12, 2025 09:39
@Zheng-Li01 Zheng-Li01 added the waiting-review This item is waiting on review by one or more members of team label Mar 12, 2025
@codecov
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.54578%. Comparing base (df745d6) to head (eebfade).
Report is 108 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13122         +/-   ##
===================================================
+ Coverage   61.32538%   61.54578%   +0.22039%     
===================================================
  Files           1543        1549          +6     
  Lines         158339      158612        +273     
  Branches       14745       14758         +13     
===================================================
+ Hits           97102       97619        +517     
+ Misses         60539       60291        -248     
- Partials         698         702          +4     
Flag Coverage Δ
Debug 61.54578% <100.00000%> (-13.76757%) ⬇️
integration 10.73289% <ø> (-8.17760%) ⬇️
production 39.49480% <ø> (-35.81856%) ⬇️
test 95.67585% <100.00000%> (∅)
unit 36.93452% <ø> (-37.46616%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Tanya-Solyanik
Copy link
Contributor

Tanya-Solyanik commented Mar 12, 2025

  Test failed and will automatically retry. Failure details follow:

Expected type to be System.NotSupportedException, but found System.IO.MemoryStream.
at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
at FluentAssertions.Execution.DefaultAssertionStrategy.HandleFailure(String message)
at FluentAssertions.Execution.AssertionChain.FailWith(Func1 getFailureReason) at FluentAssertions.Execution.AssertionChain.FailWith(Func1 getFailureReason)
at FluentAssertions.Execution.AssertionChain.FailWith(String message)
at FluentAssertions.Types.TypeAssertions.Be(Type expected, String because, Object[] becauseArgs)
at FluentAssertions.Primitives.ReferenceTypeAssertions2.BeOfType(Type expectedType, String because, Object[] becauseArgs) at FluentAssertions.Primitives.ReferenceTypeAssertions2.BeOfType[T](String because, Object[] becauseArgs)
at System.Windows.Forms.Tests.ClipboardTests.SetData_CustomFormat_Exception_BinaryFormatterDisabled_SerializesException() in /_/src/test/unit/System.Windows.Forms/System/Windows/Forms/ClipboardTests.cs:line 554
at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

@LeafShi1 LeafShi1 requested a review from Epica3055 March 18, 2025 02:47
@Olina-Zhang Olina-Zhang added waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Mar 19, 2025
@Zheng-Li01 Zheng-Li01 added waiting-review This item is waiting on review by one or more members of team and removed waiting-author-feedback The team requires more information from the author labels Mar 24, 2025
Copy link
Member

@Epica3055 Epica3055 left a comment

Choose a reason for hiding this comment

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

looks good 👍

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds unit tests for the DataSourceListEditor to improve coverage for its public methods.

  • Introduces tests for checking the resizable drop-down property.
  • Verifies EditValue behavior under various parameter scenarios.
  • Confirms that GetEditStyle returns the expected UI type.
Comments suppressed due to low confidence (1)

src/System.Windows.Forms.Design/tests/UnitTests/System/Windows/Forms/Design/DataSourceListEditorTests.cs:33

  • [nitpick] Consider also asserting the returned value from EditValue when valid inputs are provided, if the expected behavior can be predicted beyond ensuring no exception is thrown.
_dataSourceListEditor.EditValue(context: contextMock.Object, provider: providerMock.Object, value: null);

Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

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

Other than a small comment, all LGTM!

@ricardobossan ricardobossan added waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Mar 26, 2025
@Zheng-Li01 Zheng-Li01 added waiting-review This item is waiting on review by one or more members of team and removed waiting-author-feedback The team requires more information from the author labels Mar 27, 2025
Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

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

Thank you!

ricardobossan
ricardobossan previously approved these changes Mar 27, 2025
Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Thank you!

@Tanya-Solyanik Tanya-Solyanik removed the waiting-review This item is waiting on review by one or more members of team label Mar 31, 2025
@Tanya-Solyanik Tanya-Solyanik merged commit dafcdbf into dotnet:main Mar 31, 2025
8 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview4 milestone Mar 31, 2025
@Zheng-Li01 Zheng-Li01 deleted the Add_code_coverage_for_DataSourceListEditor branch April 1, 2025 03:05
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants