コード例 #1
0
        public void CreateJsonMetadata_KeyNotFoundExceptionTest()
        {
            var filesToPack = PackageUtility.CreateFilesToPack();
            var forgeData   = SELF.CreateForgeData();

            forgeData.Remove(Conatants.PuppetForgeModuleDependency);
            PuppetProjectPackage.CreateJsonMetadata(forgeData, filesToPack);
        }
コード例 #2
0
        public void CreateJsonMetadata_Test()
        {
            var filesToPack = PackageUtility.CreateFilesToPack();
            var forgeData   = SELF.CreateForgeData();

            const string module  = @"ns/module";
            const string version = @"2.3.x";

            forgeData[Conatants.PuppetForgeModuleDependency] = string.Format(@"'{0}', '{1}'", module, version);
            var metaData = PuppetProjectPackage.CreateJsonMetadata(forgeData, filesToPack);

            Assert.AreEqual(SELF.ForgeUserName, metaData.author);
            Assert.AreEqual(filesToPack.Count, metaData.checksums.Count);
            Assert.AreEqual(module, metaData.dependencies[0].name);
            Assert.AreEqual(version, metaData.dependencies[0].version_requirement);
        }
コード例 #3
0
 public void CreateJsonMetadata_ArgumentNullException2Test()
 {
     PuppetProjectPackage.CreateJsonMetadata(SELF.CreateForgeData(), null);
 }