Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public void TearDown()
 {
     myMarker.Reset();
     myMarker = null;
 }
Esempio n. 4
0
 public void SetUp()
 {
     myMarker = new HtmlElementMarker(Color.Yellow);
 }