-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using AsyncEnumerableExtensions; | ||
using Xunit; | ||
|
||
namespace UnitTestProject1 | ||
{ | ||
public class UnitTest1 | ||
{ | ||
[Fact] | ||
public async void Test1() | ||
{ | ||
async Task Generator(IAsyncEnumerableSink<int> sink) | ||
{ | ||
await sink.Yield(10); | ||
await sink.Yield(20); | ||
await Task.Delay(100); | ||
await sink.Yield(30); | ||
await sink.Yield(40); | ||
await Task.Delay(100); | ||
await sink.Yield(50); | ||
} | ||
|
||
Assert.Equal(new[] {10, 20, 30, 40, 50}, | ||
await AsyncEnumerableFactory.FromAsyncGenerator<int>(Generator).ToArray()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" /> | ||
<PackageReference Include="xunit" Version="2.2.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AsyncEnumerableExtensions\AsyncEnumerableExtensions.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |