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

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

            scriptLoader.Expect(s => s.GetJQueryInstallScript()).Returns(jQueryInstallScript);
            domContainer.Expect(s => s.Eval(jQueryInstallScript)).Returns(Some.String()).Verifiable();

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

            sut.DoEnterMatch();
        }
Beispiel #2
0
        public void TestEnterMatch_ensuresJQueryIsAvailable()
        {
            string jQueryInstallScript = Some.String();

            Mock<IScriptLoader> scriptLoader = new Mock<IScriptLoader>();
            Mock<WatiN.Core.DomContainer> domContainer = new Mock<DomContainer>();
            
            scriptLoader.Expect(s => s.GetJQueryInstallScript()).Returns(jQueryInstallScript);
            domContainer.Expect(s => s.Eval(jQueryInstallScript)).Returns(Some.String()).Verifiable();

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

            sut.DoEnterMatch();
        }
Beispiel #3
0
        public void TestExitMatch_removesCssClass()
        {
            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.Expect(s => s.GetCssMarkRemovalScript(cssSelector, markerClass)).Returns(markingScript).Verifiable();

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

            sut.Initialize(cssSelector);

            sut.DoEnterMatch();

            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.Expect(s => s.GetCssMarkingScript(cssSelector, markerClass)).Returns(markingScript);
            domContainer.Expect(d => d.Eval(markingScript)).Returns(Some.String()).Verifiable();

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

            sut.Initialize(cssSelector);

            sut.DoEnterMatch();

            domContainer.Verify();
        }