Skip to content

Commit

Permalink
[#90] REFACTOR: remove test data var for KISS over DRY in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaka committed Nov 5, 2024
1 parent b53fd80 commit 24ffe02
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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)
Expand Down

0 comments on commit 24ffe02

Please sign in to comment.