public void ToYaml_ProducesValidYaml()
        {
            var doc = new GitBinDocument("name");
            doc.RecordChunk("abcde");
            doc.RecordChunk("zyxwv");

            var actualYaml = GitBinDocument.ToYaml(doc);

            Assert.AreEqual(expectedYaml, actualYaml);
        }
Exemple #2
0
        public static string ToYaml(GitBinDocument document)
        {
            var sb = new StringBuilder();
            var stringWriter = new StringWriter(sb);

            var serializer = new YamlSerializer<GitBinDocument>();
            serializer.Serialize(stringWriter, document);

            return sb.ToString();
        }
Exemple #3
0
        public static string ToYaml(GitBinDocument document)
        {
            var sb           = new StringBuilder();
            var stringWriter = new StringWriter(sb);

            var serializer = new YamlSerializer <GitBinDocument>();

            serializer.Serialize(stringWriter, document);

            return(sb.ToString());
        }
Exemple #4
0
        public static string ToYaml(GitBinDocument document)
        {
            var sb = new StringBuilder();
            var stringWriter = new StringWriter(sb);

            var serializer = new YamlSerializer<GitBinDocument>();
            serializer.Serialize(stringWriter, document);

            if (Environment.OSVersion.Platform == PlatformID.MacOSX ||
                Environment.OSVersion.Platform == PlatformID.Unix)
            {
                sb.Replace("\n", "\r\n");
            }

            return sb.ToString();
        }
Exemple #5
0
        public static string ToYaml(GitBinDocument document)
        {
            var sb           = new StringBuilder();
            var stringWriter = new StringWriter(sb);

            var serializer = new YamlSerializer <GitBinDocument>();

            serializer.Serialize(stringWriter, document);

            if (Environment.OSVersion.Platform == PlatformID.MacOSX ||
                Environment.OSVersion.Platform == PlatformID.Unix)
            {
                sb.Replace("\n", "\r\n");
            }

            return(sb.ToString());
        }