예제 #1
0
        public void FromYaml_DeserializedCorrectly()
        {
            var target = GitBinDocument.FromYaml(new StringReader(expectedYaml));

            Assert.AreEqual("name", target.Filename);
            Assert.AreEqual(2, target.ChunkHashes.Count);
            Assert.AreEqual("abcde", target.ChunkHashes[0]);
            Assert.AreEqual("zyxwv", target.ChunkHashes[1]);
        }
예제 #2
0
        public void Execute()
        {
            var stdin    = Console.OpenStandardInput();
            var document = GitBinDocument.FromYaml(new StreamReader(stdin));

            GitBinConsole.Write("Smudging {0}:", document.Filename);

            DownloadMissingFiles(document.ChunkHashes);

            OutputReassembledChunks(document.ChunkHashes);
        }
예제 #3
0
        public void Execute()
        {
            var stdin    = Console.OpenStandardInput();
            var document = GitBinDocument.FromYaml(new StreamReader(stdin));

            GitBinConsole.Write("Smudging {0}...", document.Filename);

            DownloadMissingFiles(document.ChunkHashes);
            OutputReassembledChunks(document.ChunkHashes);

/* TODO: move to SparkleShare
 *          string filepath = Path.Combine (Environment.CurrentDirectory,
 *              document.Filename.Replace("/", Path.DirectorySeparatorChar.ToString()));
 *
 *          FileInfo fileInfo         = new FileInfo(filepath);
 *          fileInfo.CreationTimeUtc  = new DateTime(1970, 1, 1).AddSeconds(document.CreationTime);
 *          fileInfo.LastWriteTimeUtc = new DateTime(1970, 1, 1).AddSeconds(document.LastWriteTime);
 */
        }