Support task result assertion #783
Replies: 2 comments
-
Very nice issue bro |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the suggestion! It looks like this could lead to an explosion of new methods: (await TaskReturningMethod(params)).ShouldBe(expectedResult);
(await TaskReturningMethod(params)).ShouldNotBeNull(); And for tasks with a void result: await TaskReturningMethod(params); Have you found there to be friction using the current composable building blocks shown above? We probably don't want to do something that would essentially duplicate the number of extension methods we'd have to maintain, not to mention tripling because |
Beta Was this translation helpful? Give feedback.
-
Would be a great additions if Shouldly endured the assertion of tasks results.
My suggestion is something like that:
await anyTaskRetuningValue(params).ShouldReturnAsync(assertionComparer)
await anyTaskRetuningValue(params).ShouldNotReturnNullAsync()
And for tasks without returning value:
await anyTaskWithoutReturningValue().ShouldRunSuccessfully()
Thanks for the amazing project!
Beta Was this translation helpful? Give feedback.
All reactions