Skip to content

Move the simple test cases from ClipboardTests class to ClipboardCoreTests #13331

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
Tanya-Solyanik opened this issue Apr 21, 2025 · 2 comments
Assignees
Labels
area-Clipboard Issues related to Clipboard test-enhancement Improvements of test source code
Milestone

Comments

@Tanya-Solyanik
Copy link
Contributor

Clipboard is an OS-wide resource. It might be modified by other processes on the machine and it does not handle congestion well. We can move some of the simple tests to our mocked-up infrastructure now.
Let's start by moving test that set or query the same value twice, for example -
[WinFormsTheory]
[MemberData(nameof(ContainsMethodsTheoryData))]
public void Contains_InvokeMultipleTimes_Success(Func contains)
{
Clipboard.Clear();
bool result = contains.Invoke();
contains.Invoke().Should().Be(result);
result.Should().BeFalse();
}

We would want to keep the scenario and round-trip tests running against the "real" clipboard.

@Tanya-Solyanik Tanya-Solyanik added the test-enhancement Improvements of test source code label Apr 21, 2025
@github-actions github-actions bot added the area-Clipboard Issues related to Clipboard label Apr 21, 2025
@Tanya-Solyanik Tanya-Solyanik added this to the .NET 10.0 milestone Apr 21, 2025
@LeafShi1
Copy link
Member

Do you mean move these tests to src/System.Private.Windows.Core/tests/System.Private.Windows.Core.Tests/System/Private/Windows/Ole/ClipboardCoreTests.cs?
but looks like many methods are not included in ClipboardCore
Image

@Tanya-Solyanik
Copy link
Contributor Author

Let's move the ones that are present in ClipboardCore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Clipboard Issues related to Clipboard test-enhancement Improvements of test source code
Projects
None yet
Development

No branches or pull requests

2 participants