Ejemplo n.º 1
0
        DocProject CreateTopics()
        {
            var project = new DocProject();

            var topic = new DocTopic(null)
            {
                Title    = "Markdown Monster",
                Body     = "Markdown Monster is an easy to use Makrdown Editor and Web Publishing tool.",
                Keywords = "markdown, editor"
            };

            topic.Properties.Add("Custom", "Custom Field");
            topic.Properties.Add("Custom2", "Custom Field 2");

            var rootParentId = topic.Id;

            Assert.True(project.SaveTopic(topic), project.ErrorMessage);

            topic = new DocTopic(project)
            {
                Title    = "Markdown Monster 2",
                Body     = "Markdown Monster is an easy to use Makrdown Editor and Web Publishing tool.",
                Keywords = "markdown, editor"
            };
            topic.Properties.Add("Custom", "Custom Field");
            topic.Properties.Add("Custom2", "Custom Field 2");

            Assert.True(project.SaveTopic(topic), project.ErrorMessage);


            topic = new DocTopic(project)
            {
                ParentId = rootParentId,
                Title    = "Markdown Monster 3",
                Body     = "Markdown Monster is an easy to use Makrdown Editor and Web Publishing tool.",
                Keywords = "markdown, editor"
            };
            topic.Properties.Add("Custom", "Custom Field");
            topic.Properties.Add("Custom3", "Custom Field 3");

            Assert.True(project.SaveTopic(topic), project.ErrorMessage);

            return(project);
        }