Skip to content

Commit

Permalink
Merge pull request #43 from th3oth3rjak3/TapImprovements
Browse files Browse the repository at this point in the history
Tap improvements
  • Loading branch information
th3oth3rjak3 authored May 13, 2024
2 parents 5451889 + 6c54741 commit 98ceed3
Show file tree
Hide file tree
Showing 11 changed files with 2,118 additions and 106 deletions.
26 changes: 26 additions & 0 deletions Functional.Test/Common/CommonExtensionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,30 @@ public void EffectShouldWorkWithoutExtensionMethod()
Effect(() => effectResult = true).ShouldBeOfType<Unit>();
effectResult.ShouldBeTrue();
}

[TestMethod]
public async Task ItShouldHandleEffectAsyncWithActionInput()
{
var effectResult = false;

await EffectAsync(() => effectResult = true)
.TapAsync(output => output.ShouldBeOfType<Unit>())
.IgnoreAsync();

effectResult.ShouldBeTrue();
}

[TestMethod]
public async Task ItShouldHandleEffectAsyncWithFuncTaskInput()
{
var effectResult = false;

Task doWork() => Effect(() => effectResult = true).AsAsync();

await EffectAsync(doWork)
.TapAsync(output => output.ShouldBeOfType<Unit>())
.IgnoreAsync();

effectResult.ShouldBeTrue();
}
}
Loading

0 comments on commit 98ceed3

Please sign in to comment.