Skip to content

Adding Data, DataObject, FileDrop and Text tests to ClipboardCoreTests #13645

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Jun 24, 2025

Related #13331

Proposed changes

  • Adding Data, DataObject, FileDrop and Text tests to ClipboardCoreTests
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.69074%. Comparing base (08485db) to head (ae954c4).
Report is 11 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #13645         +/-   ##
===================================================
+ Coverage   76.60828%   76.69074%   +0.08246%     
===================================================
  Files           3253        3255          +2     
  Lines         640996      641599        +603     
  Branches       47439       47490         +51     
===================================================
+ Hits          491056      492047        +991     
+ Misses        146290      145888        -402     
- Partials        3650        3664         +14     
Flag Coverage Δ
Debug 76.69074% <ø> (+0.08246%) ⬆️
integration 18.98826% <ø> (-0.00558%) ⬇️
production 51.20523% <ø> (+0.13622%) ⬆️
test 97.41503% <ø> (+0.00328%) ⬆️
unit 48.58591% <ø> (+0.13901%) ⬆️

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.

@LeafShi1 LeafShi1 changed the title Adding DataObject tests to ClipboardCoreTests Adding Data, DataObject, FileDrop and Text tests to ClipboardCoreTests Jun 25, 2025
Copy link
Contributor

@Copilot 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 expands ClipboardCoreTests by adding comprehensive tests for various SetData scenarios, including custom formats, object data, file drops, image/bitmap/metafile handling, and multiple text formats. It also updates the test project to reference drawing and GDI+ libraries and includes bitmap assets for testing.

  • Introduces TheoryData and parameterized tests for custom data formats and exception types
  • Adds tests for SetDataObject overloads, file drop lists, images, metafiles, and text formats
  • Updates .csproj to reference System.Drawing.Common and GDI+ and to include bitmap fixtures

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
ClipboardCoreTests.cs Added new tests covering custom formats, objects, file drops, images, metafiles, and text formats
System.Private.Windows.Core.Tests.csproj Added references for drawing/GDI+ libraries and included bitmap content
Comments suppressed due to low confidence (1)

src/System.Private.Windows.Core/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs:505

  • The StringCollection is being initialized with a C# 12 array literal, which produces a string[], not a StringCollection. Use a collection initializer or add items via new StringCollection { "filePath", "filePath2" }.
        StringCollection filePaths =

@LeafShi1
Copy link
Member Author

@JeremyKuhne Please help review this PR.

Currently all SimpleTests have been added to ClipboardCoreTests. Do the remaining cases need to be moved here?
Currently unimplemented, such as tests related to JsonDataObject and UntypedDataObject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant