Skip to content

Commit

Permalink
Update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
heku committed Sep 8, 2023
1 parent 5b47d41 commit 9c7ddf1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Kunet.AsyncInterceptor.Tests/AsyncInterceptorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ public async Task InterceptByManyReturnValueFormattersTest()
Assert.Equal("1 2 3 value 3 2 1", await proxy.GetValueTask<string>());
}

[Fact]
public async Task InterceptCustomTaskLikeReturnValueExample()
[Theory]
[InlineData(false)]
[InlineData(true)]
public async Task InterceptCustomTaskLikeReturnValueExample(bool useCustomAsyncAdapter)
{
// MyTask<T> is an example custom task-like type
AsyncAdapter.Register(typeof(MyTask<>), typeof(AsyncAdapterOfMyTask<>));
if (useCustomAsyncAdapter)
{
// MyTask<T> is an example custom task-like type
AsyncAdapter.Register(typeof(MyTask<>), typeof(AsyncAdapterOfMyTask<>));
}

var target = Mock.Of<IGet>(x =>
x.GetTaskLikeType<string>() == new MyTask<string>("value")
Expand Down

0 comments on commit 9c7ddf1

Please sign in to comment.