public void TestEnterMatch_ensuresJQueryIsAvailable()
        {
            string jQueryInstallScript = Some.String();

            Mock <IScriptLoader>           scriptLoader = new Mock <IScriptLoader>();
            Mock <WatiN.Core.DomContainer> domContainer = new Mock <DomContainer>();

            scriptLoader.Setup(s => s.GetJQueryInstallScript()).Returns(jQueryInstallScript);
            domContainer.Setup(s => s.Eval(jQueryInstallScript)).Verifiable();

            var sut = new CssSelectorConstraint(scriptLoader.Object, domContainer.Object);

            sut.EnterMatch();

            domContainer.Verify();
        }
        public void TestEnterMatch_usesCssSelectorToAddCssClass()
        {
            string cssSelector = Some.String();
            string markerClass = Some.String();

            string markingScript = Some.String();

            Mock <IScriptLoader>           scriptLoader = new Mock <IScriptLoader>();
            Mock <WatiN.Core.DomContainer> domContainer = new Mock <DomContainer>();

            scriptLoader.Setup(s => s.GetCssMarkingScript(cssSelector, markerClass)).Returns(markingScript);
            domContainer.Setup(d => d.Eval(markingScript)).Verifiable();

            var sut = new CssSelectorConstraint(scriptLoader.Object, domContainer.Object);

            sut.Initialize(cssSelector, markerClass);

            sut.EnterMatch();

            domContainer.Verify();
        }