-
Notifications
You must be signed in to change notification settings - Fork 6
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
OSOE-123: Clean up and simplify OrchardCoreUITestBase #170
Conversation
"S4261:Methods should be named according to their synchronicities", | ||
Justification = | ||
"This is a conversion method, and we want to make it explicit that the result has an async signature.")] | ||
public static MultiSizeTestAsync ToAsync(this MultiSizeTest test) => |
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.
I think it's still misleading becuase you'd assume this method does something similar to Task.Run()
instead of just returning Task.CompletedTask
. So to me this hurts more than it helps. How about one of these mouthfuls?
ReturnCompletedTask
WithCompletedTask
ToMultiSizeTestAsyncWithCompletedTask
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.
Maybe .AsCompletedTask()
?
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.
That's fine too.
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.
I'm thinking that the Completed
infix is a lot of implementation noise that shouldn't be there, don't you think? Considering just .AsTask()
now.
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.
I think whether a task will actually start a thread or not is useful information, not noise.
"S4261:Methods should be named according to their synchronicities", | ||
Justification = | ||
"This is a conversion method, and we want to make it explicit that the result has an async signature.")] | ||
public static Func<T, Task> ToAsync<T>(this Action<T> action) => |
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.
Same.
@@ -13,49 +13,40 @@ namespace Lombiq.Tests.UI; | |||
|
|||
public abstract class OrchardCoreUITestBase | |||
{ | |||
private const string AppFolder = "AppFolder"; |
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.
Is there a reason this isn't using nameof
?
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.
Only that it used to be a method-local constant named appFolder
. After moving it to the top of the file it became this - and I didn't catch it.
OSOE-123