Esempio n. 1
0
        //[Test]
        public void GenerateGoldenStandardFiles()
        {
            const string TableFile      = @".\table.txt";
            const string EntriesFile    = @".\entries.json";
            const string SimpleTextFile = @".\simple.json";
            var          table          = new StringTable();

            File.WriteAllText(TableFile,
                              string.Join("", table.GetBytes().Select(x => x.ToString("X2"))));

            File.WriteAllText(EntriesFile, JsonConvert.SerializeObject(
                                  table.entries.ToDictionary(x => x.name, x => string.Join("", x.bytes.Select(b => b.ToString("X2")))), Formatting.Indented));

            File.WriteAllText(SimpleTextFile, JsonConvert.SerializeObject(
                                  SimpleTextEntries().ToDictionary(x => x, x => {
                var type  = Enum.Parse <ItemType>(x);
                var bytes = Dialog.Simple(Texts.ItemTextbox(new Item {
                    Type = type
                }));
                return(string.Join("", bytes.Select(b => b.ToString("X2"))));
            }), Formatting.Indented));
        }