-
Notifications
You must be signed in to change notification settings - Fork 1k
Adding GetData test and SetAudio tests to ClipboardCoreTests #13464
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
Adding GetData test and SetAudio tests to ClipboardCoreTests #13464
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds new unit tests to validate ClipboardCore
’s GetData and SetAudio behavior, ensuring correct handling of text formats and audio data via byte arrays and streams.
- Tests for
SetData
/GetData
withUnicodeText
and null/empty/invalid formats - Tests for
SetAudio
with both byte arrays andStream
inputs, plus a helper data provider
Comments suppressed due to low confidence (3)
src/System.Private.Windows.Core/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs:384
- [nitpick] The test name implies
GetData
returns null, but it only checksGetDataPresent
; consider renaming toGetDataPresent_NullOrEmptyFormat_ReturnsFalse
for clarity.
public void GetData_NullOrEmptyFormat_Returns_Null(string? format)
src/System.Private.Windows.Core/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs:386
- Currently the test only asserts
GetDataPresent
; add an assertion foroutData.GetData(format)
returning null to cover both API calls.
ClipboardCore.SetData(new DataObject(SomeDataObject.Format, null!), copy: false, retryTimes: 1, retryDelay: 0);
src/System.Private.Windows.Core/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs:418
- [nitpick] The name
GetEmptyStreamData
suggests only empty streams but also yields non-empty data; consider renaming toGetStreamAudioData
or similar.
public static IEnumerable<object[]> GetEmptyStreamData()
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13464 +/- ##
===================================================
+ Coverage 76.60371% 76.61323% +0.00951%
===================================================
Files 3230 3237 +7
Lines 639097 639477 +380
Branches 47289 47319 +30
===================================================
+ Hits 489572 489924 +352
- Misses 145953 146029 +76
+ Partials 3572 3524 -48
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than small comments, all LGTM!
...ore/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs
Show resolved
Hide resolved
...ore/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs
Show resolved
Hide resolved
...ore/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit remark.
Merge it, if you like!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All LGTM!
Related #13331
Proposed changes
Adding
GetData
tests andSetAudio
tests toClipboardCoreTests
Microsoft Reviewers: Open in CodeFlow