Exemplo n.º 1
0
        public static void ParseArtefactsToXML()
        {
            var directory    = @"E:\Documents\Tabletop RPGs\Numenera\APPs\Artefacts\";
            var name         = "RAW_Artefacts_Compendium.txt";
            var fileName     = Path.Combine(directory, name);
            var fileNameXml  = fileName + "_xml.xml";
            var deviceParser = new DevicesParser("Compendium", DeviceType.Artefact);

            deviceParser.CreateXMLFromRawArtefactsText(fileName, fileNameXml);
            var cyphers = NumeneraXML.DeserializeArtefactsListFromXML(fileNameXml);

            cyphers.ForEach(x => Console.WriteLine(x));
        }
Exemplo n.º 2
0
        public void TestPDFParsing_Artefacts()
        {
            var directory    = @"..\..\..\ExampleFiles";
            var name         = "Test_Artefacts.txt";
            var fileName     = Path.Combine(directory, name);
            var fileNameXml  = Path.Combine(directory, Path.GetFileNameWithoutExtension(fileName) + ".xml");
            var deviceParser = new DevicesParser("Discovery", DeviceType.Artefact);

            deviceParser.CreateXMLFromRawArtefactsText(fileName, fileNameXml);
            var artefacts = NumeneraXML.DeserializeArtefactsListFromXML(fileNameXml);

            System.Diagnostics.Debug.WriteLine(artefacts[0].Name);
            artefacts.Should().BeEquivalentTo(ArtefactsExample.List);
            //artefacts[1].Should().BeEquivalentTo(ArtefactsExample.List[1]);
        }