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.
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.