Пример #1
0
        public string CreateSalesforceDelta(CommandLineArgs args)
        {
            var changes = _differ.RetrieveChanges(args.Repo, args.TargetBranch, args.SourceBranch);

            var tempDirectory = _bundler.CreateTempDirectoryFromDiff(changes);
            var metaDataRoot  = Path.Combine(tempDirectory, args.MetadataDirectory);

            var manifest    = _manifestGenerator.GenerateFor(metaDataRoot);
            var manifestXml = _manifestGenerator.Serialize(manifest);

            var packageTempLocation = Path.Combine(tempDirectory, "delta.zip");

            _fs.File.WriteAllText(_fs.Path.Combine(metaDataRoot, "package.xml"), manifestXml);
            _packager.Package(metaDataRoot, packageTempLocation);

            _output.WriteLine($"Copying '{packageTempLocation}' to '{args.OutputLocation}'...");

            File.Copy(packageTempLocation, args.OutputLocation, true);
            return(args.OutputLocation);
        }
Пример #2
0
        public void RetrieveChanges_PathNotFound_Throws()
        {
            var ex = Assert.Throws <DirectoryNotFoundException>(() => _differ.RetrieveChanges(@"c:\doesnotexist", "", ""));

            Assert.That(ex.Message, Does.Contain(@"c:\doesnotexist"));
        }