From 50353aecc2fabd100b111adb01539f32b1ebbdc2 Mon Sep 17 00:00:00 2001 From: Memek Date: Wed, 8 Feb 2023 16:31:13 +0100 Subject: [PATCH] Test RecyclableArrayList.ConstructorShouldAcceptDuplicates added. --- .../RecyclableArrayListTests.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Recyclable.CollectionsTests/RecyclableArrayListTests.cs b/Recyclable.CollectionsTests/RecyclableArrayListTests.cs index 34af720..ea2b392 100644 --- a/Recyclable.CollectionsTests/RecyclableArrayListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableArrayListTests.cs @@ -319,5 +319,19 @@ namespace Recyclable.CollectionsTests _ = list.Count.Should().Be(testNumbers.Length); _ = list.Should().BeEquivalentTo(testNumbers); } + + [Fact] + public void ConstructorShouldAcceptDuplicates() + { + // Prepare + int[] testNumbers = new[] { 1, 2, 2, 3 }; + + // Act + using var list = new RecyclableArrayList(testNumbers); + + // Validate + _ = list.Count.Should().Be(testNumbers.Length); + _ = list.Should().BeEquivalentTo(testNumbers); + } } } \ No newline at end of file