Initial version of RecyclableBlockList implemented.

Tests switched to xUnit in hope to avoid stability issues.
This commit is contained in:
mlemanczyk committed 2023-01-07 20:52:01 +01:00
1 parent aba28028b1
commit 93b8dc5317
17 files changed
+969 -228

No files matched your search

@@ -3,12 +3,11 @@ using Recyclable.Collections;
namespace Recyclable.CollectionsTests
{
[TestClass]
public class RecyclableStackTests
{
private static readonly string[] _testData = new[] { "a", "d", "c", "b", "a" };
[TestMethod]
[Fact]
public void GetEnumeratorShouldYieldAllItemsInReversedOrder()
{
// Prepare
@@ -26,7 +25,7 @@ namespace Recyclable.CollectionsTests
_ = actual.Should().ContainInConsecutiveOrder(_testData.Reverse());
}
[TestMethod]
[Fact]
public void ShouldNotBeSortedWhenCreated()
{
// Act
@@ -37,7 +36,7 @@ namespace Recyclable.CollectionsTests
.And.ContainInConsecutiveOrder(_testData);
}
[TestMethod]
[Fact]
public void ShouldBeEmptyWhenNotInitialized()
{
// Act
@@ -47,7 +46,7 @@ namespace Recyclable.CollectionsTests
_ = sortedList.Should().BeEmpty();
}
[TestMethod]
[Fact]
public void ShouldNotBeSortedWhenInitialized()
{
// Act
@@ -66,7 +65,7 @@ namespace Recyclable.CollectionsTests
.And.BeEquivalentTo(_testData);
}
[TestMethod]
[Fact]
public void ShouldBeEmptyAfterClear()
{
// Prepare
@@ -79,7 +78,7 @@ namespace Recyclable.CollectionsTests
_ = sortedList.Should().BeEmpty();
}
[TestMethod]
[Fact]
public void PopShouldReturnItemsInReversedOrder()
{
// Prepare
@@ -101,8 +100,7 @@ namespace Recyclable.CollectionsTests
_ = dequeuedItems.Should().ContainInConsecutiveOrder(_testData.Reverse());
}
[TestMethod]
[ExpectedException(typeof(ArgumentOutOfRangeException))]
[Fact]
public void PopShoudRaiseArgumentOutOfRangeWhenNoMoreElementsFound()
{
// Prepare
@@ -114,7 +112,7 @@ namespace Recyclable.CollectionsTests
_ = list.Dequeue();
}
_ = list.Dequeue();
_ = Assert.Throws<ArgumentOutOfRangeException>(() => list.Dequeue());
}
}
}