From 230401a56b871eefea6264649dbe7b515858718d Mon Sep 17 00:00:00 2001 From: Memek Date: Wed, 8 Feb 2023 14:46:47 +0100 Subject: [PATCH] Test RecyclableList.LongIndexOfShouldReturnCorrectIndexes added. --- .../RecyclableListTests.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Recyclable.CollectionsTests/RecyclableListTests.cs b/Recyclable.CollectionsTests/RecyclableListTests.cs index 9416e5d..fd85871 100644 --- a/Recyclable.CollectionsTests/RecyclableListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableListTests.cs @@ -289,5 +289,24 @@ namespace Recyclable.CollectionsTests // Act _ = Assert.Throws(() => list.Insert(0, -1)); } + + [Fact] + public void LongIndexOfShouldReturnCorrectIndexes() + { + // Prepare + var testData = _testData.ToArray(); + var list = new RecyclableList(testData); + + // Act & Validate + foreach (var item in testData) + { + // Act + var index = list.LongIndexOf(item); + + // Validate + _ = index.Should().Be(item - 1); + } + } + } -} +} \ No newline at end of file