//ExEnd

        private void TestCreateEditableRanges(Document doc, EditableRangeInfoPrinter visitor)
        {
            NodeCollection editableRangeStarts = doc.GetChildNodes(NodeType.EditableRangeStart, true);

            Assert.AreEqual(2, editableRangeStarts.Count);
            Assert.AreEqual(2, doc.GetChildNodes(NodeType.EditableRangeEnd, true).Count);

            EditableRange range = ((EditableRangeStart)editableRangeStarts[0]).EditableRange;

            Assert.AreEqual(0, range.Id);
            Assert.AreEqual("*****@*****.**", range.SingleUser);
            Assert.AreEqual(EditorType.Unspecified, range.EditorGroup);

            range = ((EditableRangeStart)editableRangeStarts[1]).EditableRange;

            Assert.AreEqual(1, range.Id);
            Assert.AreEqual("*****@*****.**", range.SingleUser);
            Assert.AreEqual(EditorType.Unspecified, range.EditorGroup);

            string visitorText = visitor.ToText();

            Assert.True(visitorText.Contains("Paragraph inside first editable range"));
            Assert.True(visitorText.Contains("Paragraph inside second editable range"));
        }
        [Test] //ExSkip
        public void CreateEditableRanges()
        {
            Document doc = new Document(MyDir + "Document.doc");
            DocumentBuilder builder = new DocumentBuilder(doc);

            // Start an editable range
            EditableRangeStart edRange1Start = builder.StartEditableRange();

            // An EditableRange object is created for the EditableRangeStart that we just made
            EditableRange editableRange1 = edRange1Start.EditableRange;

            // Put something inside the editable range
            builder.Writeln("Paragraph inside first editable range");

            // An editable range is well-formed if it has a start and an end
            // Multiple editable ranges can be nested and overlapping 
            EditableRangeEnd edRange1End = builder.EndEditableRange();

            // Explicitly state which EditableRangeStart a new EditableRangeEnd should be paired with
            EditableRangeStart edRange2Start = builder.StartEditableRange();
            builder.Writeln("Paragraph inside second editable range");
            EditableRange editableRange2 = edRange2Start.EditableRange;
            EditableRangeEnd edRange2End = builder.EndEditableRange(edRange2Start);

            // Editable range starts and ends have their own respective node types
            Assert.AreEqual(NodeType.EditableRangeStart, edRange1Start.NodeType);
            Assert.AreEqual(NodeType.EditableRangeEnd, edRange1End.NodeType);

            // Editable range IDs are unique and set automatically
            Assert.AreEqual(0, editableRange1.Id);
            Assert.AreEqual(1, editableRange2.Id);

            // Editable range starts and ends always belong to a range
            Assert.AreEqual(edRange1Start, editableRange1.EditableRangeStart);
            Assert.AreEqual(edRange1End, editableRange1.EditableRangeEnd);

            // They also inherit the ID of the entire editable range that they belong to
            Assert.AreEqual(editableRange1.Id, edRange1Start.Id);
            Assert.AreEqual(editableRange1.Id, edRange1End.Id);
            Assert.AreEqual(editableRange2.Id, edRange2Start.EditableRange.Id);
            Assert.AreEqual(editableRange2.Id, edRange2End.EditableRangeStart.EditableRange.Id);

            // If the editable range was found in a document, it will probably have something in the single user property
            // But if we make one programmatically, the property is null by default
            Assert.AreEqual(null, editableRange1.SingleUser);

            // We have to set it ourselves if we want the ranges to belong to somebody
            editableRange1.SingleUser = "******";
            editableRange2.SingleUser = "******";

            // Initialize a custom visitor for editable ranges that will print their contents 
            EditableRangeInfoPrinter editableRangeReader = new EditableRangeInfoPrinter();

            // Both the start and end of an editable range can accept visitors, but not the editable range itself
            edRange1Start.Accept(editableRangeReader);
            edRange2End.Accept(editableRangeReader);
            
            // Or, if we want to go over all the editable ranges in a document, we can get the document to accept the visitor
            editableRangeReader.Reset();
            doc.Accept(editableRangeReader);

            Console.WriteLine(editableRangeReader.ToText());
        }