Skip to content

Commit

Permalink
revert changes in async chain tests
Browse files Browse the repository at this point in the history
I have not seen the test description before
  • Loading branch information
mariusz96 authored Aug 2, 2024
1 parent d4a892e commit 10b3b7a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,15 @@ public void Chain_AddTypeThatIsNotAMiddleware_ThrowsException()
/// Try to generate a deadlock in synchronous middleware.
/// </summary>
[Fact]
public async Task Execute_SynchronousChainOfResponsibility_SuccessfullyExecute()
public void Execute_SynchronousChainOfResponsibility_SuccessfullyExecute()
{
var responsibilityChain = new AsyncResponsibilityChain<string, string>(new ActivatorMiddlewareResolver())
.Chain<SyncReplaceNewLineMiddleware>()
.Chain<SyncTrimMiddleware>()
.Finally(input => Task.FromResult(input));

var result = await responsibilityChain.Execute(" Test\nwith spaces\n and new lines \n ");
var resultTask = responsibilityChain.Execute(" Test\nwith spaces\n and new lines \n ");
var result = resultTask.Result;

Check warning on line 181 in src/PipelineNet.Tests/ChainsOfResponsibility/AsyncResponsibilityChainTests.cs

View workflow job for this annotation

GitHub Actions / build

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Check warning on line 181 in src/PipelineNet.Tests/ChainsOfResponsibility/AsyncResponsibilityChainTests.cs

View workflow job for this annotation

GitHub Actions / build

Test methods should not use blocking task operations, as they can cause deadlocks. Use an async test method and await instead. (https://xunit.net/xunit.analyzers/rules/xUnit1031)

Assert.Equal("Test with spaces and new lines", result);
}
Expand Down

0 comments on commit 10b3b7a

Please sign in to comment.