public void WillMatchIdAndClassWithIdAndhMatchingClassOnAnElementWithExtraClasses() { var target = "#icons.blue.red h1#myit.myclass.other .new .warnings.red.small div.cls.clp"; var comparable = "#icons.blue #myit.other"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillMatchElementWithTargeElementThatHasAnId() { var target = "#icons h1#myit .new .warnings.red.small div.cls.clp"; var comparable = "h1 div.clp"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillMatchOnSingleElements() { var target = "#icons .new .warnings.red div"; var comparable = "div"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillMatchElementAfterPartialMatch() { var target = "#icons .new .ne .warnings.red.small div.cls"; var comparable = "#icons .ne"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillNotMatchOnMultipleElementsInDifferentOrder() { var target = "#icons .new .warnings.red div"; var comparable = "div .new"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillMatcMatchingElementWithoutClassToElementWithClass() { var target = "#icons .new .warnings.red div.cls"; var comparable = ".new div"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillNotMatcWithForeignElement() { var target = "#icons .new .warnings.red div"; var comparable = ".new div h1"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillMatchElementWithClassesGettingMatchedByElementInTarget() { var target = "#icons .new .warnings.red.small div.cls.clp"; var comparable = "#icons div.clp"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillNotMatchPartialStringMatch() { var target = "#icons .new .warnings.red div.cls"; var comparable = ".ne div"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillNotMatchIdWithIdWithMatchingClassAndMisMachingClass() { var target = "#icons.blue.red h1#myit .new .warnings.red.small div.cls.clp"; var comparable = "#icons.blue.green div.clp"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillMatchChildSelectors() { var target = "div.stats-bar > span.icon.gold"; var comparable = "div.stats-bar > span.icon"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillNotMatchMismatchingChildSelectors() { var target = "div.stats-bar>span.icon"; var comparable = "div.icon"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillNotMatchPseudoClassesToNonPseudoClasses() { var target = "#icons.blue.red a"; var comparable = "* #icons.blue a:link"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillNotMatchUniversalSelectorAndNonMatchingIDAndClass() { var target = "#icons.blue.red h1#myit.myclass.other .new .warnings.red.small div.cls.clp"; var comparable = "*#icons.blue.green #myit.other"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillMatchUniversalSelectorAsOnlySelector() { var target = "#icons.blue.red h1#myit.myclass.other .new .warnings.red.small div.cls.clp"; var comparable = "*"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillMatchMultipleClassesWhenTargetHasMoreThenCamparableAndFirstMatchFailed() { var target = "#icons .new .small.blue.warnings .warnings.red.small div.cls"; var comparable = "#icons .small.red.warnings"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillNotMatchLoneIdIfTargetIsTiedToElement() { var target = "#icons h1#myid .new .warnings.red.small div.cls.clp"; var comparable = "#myid div.clp"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillNotMatchElementWithNoClassesIfComparableHasClass() { var target = "#icons .new .warnings.red.small div"; var comparable = "#icons div.div"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillNotMatchElementWithMoreClassesThanElementInTarget() { var target = "#icons .new .warnings.red.small div.cls"; var comparable = "#icons div.cls.clp"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillMatchStandAloneClassTiedToElementInTarget() { var target = "#icons .new .warnings.red.small div.cls"; var comparable = "#icons .cls"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillNotMatchMultipleClassesWhenComparableHasMoreThanTarget() { var target = "#icons .new .warnings.red.small div.cls"; var comparable = "#icons .small.warnings.blue"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.False(result); }
public void WillMatchLoneIdWithIdWithClass() { var target = "#icons.blue h1#myit .new .warnings.red.small div.cls.clp"; var comparable = "#icons div.clp"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }
public void WillMatcSingleClassToMiltiClassContainingSingleClass() { var target = "#icons .new .warnings.red div.cls"; var comparable = "#icons .red"; var testable = new CssSelectorAnalyzer(); var result = testable.IsInScopeOfTarget(target, comparable); Assert.True(result); }