コード例 #1
0
        public void Import_Always_CorrectlyImportsXml()
        {
            var def = LoadXmls();

            var importer = new MetaXmlImporter(def);

            var assembly = Assembly.GetExecutingAssembly();

            var expectedDocumentStream = assembly.GetManifestResourceStream(TEST_DATASET);
            var x = importer.Import(expectedDocumentStream);


            var refData = TestDataset.MakeDataset();

            AssertValue(refData, x);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: xchgrbprsp/gta-toolkit
        private void ConvertXmlToResource()
        {
            string inputFileName  = arguments[0];
            string outputFileName = inputFileName.Replace(".xml", "");

            var xml      = (MetaInformationXml)null;
            var assembly = Assembly.GetExecutingAssembly();

            using (Stream xmlStream = assembly.GetManifestResourceStream("MetaTool.XmlInfos.xml"))
            {
                var ser = new XmlSerializer(typeof(MetaInformationXml));
                xml = (MetaInformationXml)ser.Deserialize(xmlStream);
            }

            var importer = new MetaXmlImporter(xml);

            var imported = importer.Import(inputFileName);

            var writer = new MetaWriter();

            writer.Write(imported, outputFileName);
        }