Exemplo n.º 1
0
        public void SaveMetadata(string filename)
        {
            Logger.LogMessage($"Saving metadata file: '{filename}'");

            var json = JsonConvert.SerializeObject(metadata, Formatting.Indented);

            vstsHelper.SaveTextFile(vstsAuthentication, project, repoName, branch, filename, json, "Updated by Markdown to WordPress. ***NO_CI***", metadataFileCreated);
        }
Exemplo n.º 2
0
        public void CreateFileTest()
        {
            var filename         = Guid.NewGuid() + ".txt";
            var expectedContents = "Hello, World!";

            // Create file
            _vstsHelper.SaveTextFile(_authentication, _projectName, _repoName, _branchName, filename, expectedContents,
                                     "Creating integration test file. ***NO_CI***", true);

            // Pull file contents (assuming it was created)
            var actualContents = _vstsHelper.GetFileContents(_authentication, _projectName, _repoName, _branchName, filename);

            // Compare contents
            Assert.AreEqual(expectedContents, actualContents);

            // Delete test file
            _vstsHelper.DeleteFile(_authentication, _projectName, _repoName, _branchName, filename, "Deleting integration test file. ***NO_CI***");
        }