From 24ffe02a199b93968229aa6cbf8a5482a413646a Mon Sep 17 00:00:00 2001 From: yashaka Date: Tue, 5 Nov 2024 20:07:29 +0200 Subject: [PATCH] [#90] REFACTOR: remove test data var for KISS over DRY in tests --- .../SharedDriver/SeleneCollection_Indexer_Specs.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/NSeleneTests/Integration/SharedDriver/SeleneCollection_Indexer_Specs.cs b/NSeleneTests/Integration/SharedDriver/SeleneCollection_Indexer_Specs.cs index 7d880c1..efcc48a 100644 --- a/NSeleneTests/Integration/SharedDriver/SeleneCollection_Indexer_Specs.cs +++ b/NSeleneTests/Integration/SharedDriver/SeleneCollection_Indexer_Specs.cs @@ -161,10 +161,9 @@ public void NoTimeout_OnMatchedCondition_OnUnmatchedCollectionElement() { Configuration.Timeout = 2.000; Given.OpenedEmptyPage(); - var validPositiveIndex = 100; var beforeCall = DateTime.Now; - SS("#will-not-appear")[validPositiveIndex].Should(Be.Not.InDom); + SS("#will-not-appear")[100].Should(Be.Not.InDom); var afterCall = DateTime.Now; Assert.IsTrue(afterCall < beforeCall.AddSeconds(Configuration.Timeout)); @@ -175,11 +174,10 @@ public void OnUnMatchedCondition_OnUnmatchedCollectionElement_ThrowExceptionWith { Configuration.Timeout = 0.25; Given.OpenedEmptyPage(); - var validPositiveIndex = 100; try { - SS("#will-not-appear")[validPositiveIndex].Should(Be.InDom); + SS("#will-not-appear")[100].Should(Be.InDom); Assert.Fail("should fail because the element should be absent"); } catch (TimeoutException error)