From 37b01147791499dbe34f1d58034de9dbfcf86c22 Mon Sep 17 00:00:00 2001 From: Memek Date: Mon, 6 Feb 2023 21:11:21 +0100 Subject: [PATCH] Test RecyclabeArrayList.AddShouldAcceptDuplicates added. --- .../RecyclableArrayListTests.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Recyclable.CollectionsTests/RecyclableArrayListTests.cs b/Recyclable.CollectionsTests/RecyclableArrayListTests.cs index 4f43224..2bcad4a 100644 --- a/Recyclable.CollectionsTests/RecyclableArrayListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableArrayListTests.cs @@ -302,5 +302,23 @@ namespace Recyclable.CollectionsTests _ = list.Contains(item).Should().BeTrue(); } } + + [Fact] + public void AddShouldAcceptDuplicates() + { + // Prepare + int[] testNumbers = new[] { 1, 2, 2, 3 }; + + // Act + using var list = new RecyclableArrayList(); + foreach (var index in testNumbers) + { + list.Add(index); + } + + // Validate + _ = list.Count.Should().Be(testNumbers.Length); + _ = list.Should().BeEquivalentTo(testNumbers); + } } } \ No newline at end of file