Пример #1
0
        public void Unmark_MultipleMarkersUnmarkedInSameOrder_LastStyleKeptUntilLastMarkerIsRemoved()
        {
            var element = Document.GetElementById("a3");

            var yellowMarker = new HtmlElementMarker(Color.Yellow);

            yellowMarker.Mark(element);
            Assert.That(element.Style, Does.Contain("background-color: yellow").IgnoreCase);

            var blueMarker = new HtmlElementMarker(Color.Blue);

            blueMarker.Mark(element);
            Assert.That(element.Style, Does.Contain("background-color: blue").IgnoreCase);

            var greenMarker = new HtmlElementMarker(Color.Green);

            greenMarker.Mark(element);
            Assert.That(element.Style, Does.Contain("background-color: green").IgnoreCase);

            yellowMarker.Unmark();
            Assert.That(element.Style, Does.Contain("background-color: green").IgnoreCase);

            blueMarker.Unmark();
            Assert.That(element.Style, Does.Contain("background-color: green").IgnoreCase);

            greenMarker.Unmark();
            Assert.That(element.Style, Is.Null);
        }
Пример #2
0
        public void Unmark_MultipleMarkersUnmarkedInReversedOrder_RollbackToPreviousStyle()
        {
            var element = Document.GetElementById("a3");

            var yellowMarker = new HtmlElementMarker(Color.Yellow);

            yellowMarker.Mark(element);
            Assert.That(element.Style, Does.Contain("background-color: yellow").IgnoreCase);

            var blueMarker = new HtmlElementMarker(Color.Blue);

            blueMarker.Mark(element);
            Assert.That(element.Style, Does.Contain("background-color: blue").IgnoreCase);

            var greenMarker = new HtmlElementMarker(Color.Green);

            greenMarker.Mark(element);
            Assert.That(element.Style, Does.Contain("background-color: green").IgnoreCase);

            greenMarker.Unmark();
            Assert.That(element.Style, Does.Contain("background-color: blue").IgnoreCase);

            blueMarker.Unmark();
            Assert.That(element.Style, Does.Contain("background-color: yellow").IgnoreCase);

            yellowMarker.Unmark();
            Assert.That(element.Style, Is.Null);
        }
Пример #3
0
        public void Mark_ParagraphWithInnerTags()
        {
            var element = Document.GetElementById("a1");

            myMarker.Mark(element);
            Assert_IsMarked(element);

            myMarker.Unmark();
            Assert_IsUnmarked(element, null);
        }