public void CanSerializeAndDeserializeMarkdown()
        {
            var sut = new NodeToFolderSerializer(new SystemIoFileSystem());

            string rootPath = Path.GetFullPath("temp2");
            var node = new TestNodeWithMarkdown{ Name = "Root", Uri = new Uri("http://root/barn"), HeadLine = "Mjallo", BirthDay = DateTime.Today, Content = new Markdown { Source =  "Mjallo"} };
            sut.Serialize(rootPath, node, recursive: false);

            string nodePath = Path.Combine(rootPath, "Root");
            File.Exists(Path.Combine(nodePath, "Content.markdown")).Should().BeTrue();

            var reloaded = (TestNodeWithMarkdown)sut.Deserialize(nodePath);
            reloaded.Content.Source.Should().Be("Mjallo");
        }
Пример #2
0
        public void CanSerializeAndDeserializeMarkdown()
        {
            var sut = new NodeToFolderSerializer(new SystemIoFileSystem());

            string rootPath = Path.GetFullPath("temp2");
            var    node     = new TestNodeWithMarkdown {
                Name = "Root", Uri = new Uri("http://root/barn"), HeadLine = "Mjallo", BirthDay = DateTime.Today, Content = new Markdown {
                    Source = "Mjallo"
                }
            };

            sut.Serialize(rootPath, node, recursive: false);

            string nodePath = Path.Combine(rootPath, "Root");

            File.Exists(Path.Combine(nodePath, "Content.markdown")).Should().BeTrue();

            var reloaded = (TestNodeWithMarkdown)sut.Deserialize(nodePath);

            reloaded.Content.Source.Should().Be("Mjallo");
        }