refactor: add Obsolete attributes to outdated methods#972
Merged
Conversation
...in preparation for v6.0.0 release
There was a problem hiding this comment.
Pull request overview
This PR prepares Testably.Abstractions.Testing for the upcoming v6.0.0 release by marking selected legacy APIs as obsolete so consumers can migrate before removal.
Changes:
- Made
Notification.ExecuteWhileWaiting(...)and related helper types unconditionally[Obsolete]. - Made
IAwaitableCallback<TValue>.Wait(filter, ...)unconditionally[Obsolete]. - Made
MockTimeSystem(ITimeProvider)unconditionally[Obsolete]. - Updated the net10.0 API approval baseline to reflect the new attributes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Tests/Api/Testably.Abstractions.Api.Tests/Expected/Testably.Abstractions.Testing_net10.0.txt | Updates API approval baseline (net10.0) to include new [Obsolete] attributes. |
| Source/Testably.Abstractions.Testing/Notification.cs | Removes conditional compilation and always applies [Obsolete] to ExecuteWhileWaiting APIs and related types. |
| Source/Testably.Abstractions.Testing/MockTimeSystem.cs | Removes conditional compilation and always applies [Obsolete] to the ITimeProvider constructor. |
| Source/Testably.Abstractions.Testing/IAwaitableCallback.cs | Removes conditional compilation and always applies [Obsolete] to the Wait(filter, ...) overload. |
Comments suppressed due to low confidence (1)
Source/Testably.Abstractions.Testing/IAwaitableCallback.cs:39
- This Wait(filter, timeout, ...) overload is now unconditionally [Obsolete]. There are existing tests that call it (e.g., wait.Wait(t => ...)) and they currently guard their own [Obsolete] annotations behind MarkExecuteWhileWaitingNotificationObsolete, which doesn’t appear to be defined. Please either update those tests to use the non-obsolete Wait/WaitAsync overloads (and apply the filter at callback creation time) or suppress CS0618 in the specific tests that intentionally cover the obsolete overload.
[Obsolete("Use another `Wait` or `WaitAsync` overload and move the filter to the creation of the awaitable callback.")]
void Wait(Func<TValue, bool>? filter = null,
int timeout = 30000,
int count = 1,
Action? executeWhenWaiting = null);
Tests/Api/Testably.Abstractions.Api.Tests/Expected/Testably.Abstractions.Testing_net10.0.txt
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR prepares Testably.Abstractions.Testing for the upcoming v6.0.0 release by marking selected legacy APIs as obsolete so consumers can migrate before removal.
Key Changes:
Notification.ExecuteWhileWaiting(...)and related helper types unconditionally[Obsolete].IAwaitableCallback<TValue>.Wait(filter, ...)unconditionally[Obsolete].MockTimeSystem(ITimeProvider)unconditionally[Obsolete].