Ejemplo n.º 1
0
        public void TestSaveMethod()
        {
            LanguageFile languageFile = new LanguageFile();

            languageFile.Load(TEST_FILE);

            MemoryStream savedStream = new MemoryStream();

            languageFile.Save(savedStream);

            savedStream.Seek(0, SeekOrigin.Begin);

            LanguageFile savedLanguageFile = new LanguageFile();

            savedLanguageFile.Load(savedStream);

            savedStream.Close();

            Assert.AreEqual(languageFile.RowCount, savedLanguageFile.RowCount, "Row counts do not match");
            Assert.AreEqual(languageFile.ColumnCount, savedLanguageFile.ColumnCount, "Column counts do not match");

            for (int i = 0; i < languageFile.RowCount; i++)
            {
                for (int j = 0; j < languageFile.ColumnCount; j++)
                {
                    Assert.AreEqual(languageFile[i][j], savedLanguageFile[i][j], "Cell values do not match");
                }
            }
        }