public void ToYaml_ProducesValidYaml() { var doc = new GitBinDocument("name"); doc.RecordChunk("abcde"); doc.RecordChunk("zyxwv"); var actualYaml = GitBinDocument.ToYaml(doc); Assert.AreEqual(expectedYaml, actualYaml); }
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(); }
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()); }
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(); }
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()); }