public void is_a_MarkerConstraint_setting_markerClass()
        {
            var expectedMarker = Some.String();

            var sut = new CssSelectorConstraint(null, null, expectedMarker);

            Assert.That(sut.ExpectedCssClass, Is.EqualTo(expectedMarker));
        }
        public void TestCanBeCreated()
        {
            var sut = new CssSelectorConstraint(null,null);

            Assert.IsInstanceOf(typeof(WatiN.Core.Constraints.Constraint), sut);
        }
        public void TestWriteDescriptionTo_uninitialized()
        {
            Mock<System.IO.TextWriter> textWriter = new Mock<TextWriter>();
            textWriter.Expect(tw => tw.Write(It.IsAny<string>())).Callback(
                delegate(string writtenText)
                {
                    Assert.That(writtenText.Contains("CssSelectorConstraint"));
                }
                ).Verifiable();

            var sut = new CssSelectorConstraint(null, null);

            sut.WriteDescriptionTo(textWriter.Object);

            textWriter.Verify();
        }
        public void TestWriteDescriptionTo()
        {
            string cssSelector = Some.String();
            string markerClass = Some.String();

            Mock<System.IO.TextWriter> textWriter = new Mock<TextWriter>();
            textWriter.Expect(tw => tw.Write(It.IsAny<string>())).Callback(
                delegate(string writtenText)
                {
                    Assert.That(writtenText.Contains("CssSelectorConstraint"));
                    Assert.That(writtenText.Contains(cssSelector));
                }
                ).Verifiable();

            var sut = new CssSelectorConstraint(null, null, markerClass);

            sut.Initialize(cssSelector);

            sut.WriteDescriptionTo(textWriter.Object);

            textWriter.Verify();
        }