Ejemplo n.º 1
0
        public void GenerateFor_GivenDirectoryWithSpecialDirectory_PrefixesWithApex(string dirname, string className)
        {
            _gen = new PackageXmlGenerator(new MockFileSystem(new Dictionary <string, MockFileData>
            {
                { $@"c:\repo\{dirname}\Salesforce1.appMenu", new MockFileData("file1") },
            }), new FakeOutput());

            var package = _gen.GenerateFor("c:\\repo");

            Assert.That(package.types[0].name, Is.EqualTo(className));
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void GenerateFor_GivenDirectory_GeneratesCorrectVersion()
        {
            var package = _gen.GenerateFor("c:\\repo");

            Assert.That(package.version, Is.EqualTo(36.0));
        }