Exemplo n.º 1
0
        public void Can_add_and_delete_gist_file()
        {
            var gateway = new GithubGateway(AccessToken);

            var newFile = "new.txt";

            gateway.WriteGistFile(GistId, newFile, "this is a new file");

            var gist = gateway.GetGist(GistId);
            var file = gist.Files[newFile];

            Assert.That(file.Filename, Is.EqualTo(newFile));
            Assert.That(file.Type, Is.EqualTo("text/plain"));
            Assert.That(file.Content, Is.EqualTo("this is a new file"));

            gateway.DeleteGistFiles(GistId, newFile);

            gist = gateway.GetGist(GistId);
            Assert.That(gist.Files.TryGetValue(newFile, out file), Is.False);
        }
Exemplo n.º 2
0
 public IgnoreResult githuDeleteGistFiles(GithubGateway gateway, string gistId, IEnumerable <string> filePaths)
 {
     gateway.DeleteGistFiles(gistId, filePaths.ToArray());
     return(IgnoreResult.Value);
 }
Exemplo n.º 3
0
 public IgnoreResult githuDeleteGistFiles(GithubGateway gateway, string gistId, string filePath)
 {
     gateway.DeleteGistFiles(gistId, filePath);
     return(IgnoreResult.Value);
 }