Beispiel #1
0
        public void SaveManyTo_Simple()
        {
            string outputFileContent = "";

            PackageDef pkg  = PackageDefExt.FromInputXml("Packages/Package/package.xml", Directory.GetCurrentDirectory());
            PackageDef pkg1 = PackageDefExt.FromInputXml("Packages/test2/package.xml", Directory.GetCurrentDirectory());

            using (Stream str = new MemoryStream())
            {
                PackageDef.SaveManyTo(str, new List <PackageDef> {
                    pkg, pkg1
                });
                using (StreamReader reader = new StreamReader(str))
                {
                    reader.BaseStream.Seek(0, 0);
                    outputFileContent = reader.ReadToEnd();
                }
            }
            // check that the package now contains the new XML Schema URL
            StringAssert.Contains("xmlns=\"http://opentap.io/schemas/package\"", outputFileContent);
            Assert.AreEqual(2, Regex.Matches(outputFileContent, "xmlns").Count);
        }