Skip to content

Commit

Permalink
add cover test for minimumCapacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Fausto David committed Feb 4, 2020
1 parent 16a78a2 commit 689f206
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ListPool.UnitTests/ListPool/ListPoolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ public void Add_item_without_indicate_capacity_of_list()
Assert.Equal(expectedItem, sut[0]);
}

[Fact]
public void Create_list_by_passing_another_without_items_set_minimum_capacity()
{
List<int> emptyList = new List<int>();

using ListPool<int> sut = new ListPool<int>(emptyList);

Assert.Equal(0, sut.Capacity);
}

public override void Add_items_when_capacity_is_full_then_buffer_autogrow()
{
Expand Down
9 changes: 9 additions & 0 deletions tests/ListPool.UnitTests/ValueListPool/ValueListPoolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ public override void Add_items_when_capacity_is_full_then_buffer_autogrow()
Assert.True(expectedItems.All(expectedItem => sut.Contains(expectedItem)));
}

[Fact]
public void Create_list_by_passing_another_without_items_set_minimum_capacity()
{
List<int> emptyList = new List<int>();

using ValueListPool<int> sut = new ValueListPool<int>(emptyList);

Assert.Equal(0, sut.Capacity);
}

public override void Contains_return_true_when_item_exists()
{
Expand Down

0 comments on commit 689f206

Please sign in to comment.