Esempio n. 1
0
        /// <summary>
        /// Imports file and exports it as text, then compares the result and test data.
        /// </summary>
        public void LangTextExportTest()
        {
            using (LNG lng = LNG.FromFile(filenameLng))
            {
                Assert.IsNotNull(lng, "LNG class FromFile failed.");

                lng.Export(filenameText);
            }

            Assert.IsTrue(File.Exists(filenameText));

            string[] parseddata = File.ReadAllLines(filenameText);

            int numEntries = parseddata.Length;

            Assert.IsTrue(numEntries > 0, "Unexpected number of entries.");
            Assert.AreEqual(numStrings, numEntries, 0, "Num strings mismatch.");

            for (int i = 0; i < numEntries; i++)
            {
                Assert.AreEqual(
                    testlist[i],
                    parseddata[i],
                    $"String {i} mismatch: {testlist[i]} vs {parseddata[i]}"
                    );
            }

            CleanUp();
        }