Пример #1
0
        public void ReplaceDeltaEnqueues()
        {
            var doc = DomOperationsTesting.CreateDocument();

            doc.OpenEventQueue();
            ReplaceDelta.Enqueue(doc, "test");
            var q = doc.GetQueue();

            Assert.Single(q);
            var first = q.Peek() as ReplaceDelta;

            Assert.NotNull(first);
            Assert.Equal("test", first !.Location);
        }
Пример #2
0
        public void TextModifiedGenerated()
        {
            var doc  = DomOperationsTesting.CreateDocument();
            var span = Element.Create("span");

            span.InnerText = "a";
            doc.Body.AppendChild(span);
            doc.OpenEventQueue();
            span.InnerText = "test";
            var q = doc.GetQueue();

            Assert.Single(q);
            var first = q.Peek() as TextModifiedDelta;

            Assert.NotNull(first);
            Assert.Equal("test", first !.Text);
            Assert.Equal(span.Id, first.ParentElementId);
            Assert.Equal(0, first.ChildNodeIndex);
        }