Skip to content

Commit

Permalink
Add tests for Repeat.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartdesmet committed Feb 22, 2019
1 parent 1d87e7a commit 3d6c430
Showing 1 changed file with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void Repeat_Null()
}

[Fact]
public async Task Repeat1Async()
public async Task Repeat_Many()
{
var xs = AsyncEnumerable.Repeat(2, 5);

Expand All @@ -32,12 +32,36 @@ public async Task Repeat1Async()
}

[Fact]
public async Task Repeat2Async()
public async Task Repeat_Zero()
{
var xs = AsyncEnumerable.Repeat(2, 0);

var e = xs.GetAsyncEnumerator();
await NoNextAsync(e);
}

[Fact]
public async Task Repeat_Count()
{
var xs = AsyncEnumerable.Repeat(2, 5);

Assert.Equal(5, await xs.CountAsync());
}

[Fact]
public async Task Repeat_ToArray()
{
var xs = AsyncEnumerable.Repeat(2, 5);

Assert.Equal(Enumerable.Repeat(2, 5), await xs.ToArrayAsync());
}

[Fact]
public async Task Repeat_ToList()
{
var xs = AsyncEnumerable.Repeat(2, 5);

Assert.Equal(Enumerable.Repeat(2, 5), await xs.ToListAsync());
}
}
}

0 comments on commit 3d6c430

Please sign in to comment.