Exemplo n.º 1
0
        public void TestRowAndColumnMethods()
        {
            const string CELL_VALUE = "Test Value";

            LanguageFile languageFile = new LanguageFile();

            languageFile.AddRow();
            languageFile.AddColumn();
            languageFile[0][0] = CELL_VALUE;

            Assert.AreEqual(languageFile.ColumnCount, 1, "Column count is incorrect");
            Assert.AreEqual(languageFile.RowCount, 1, "Row count is incorrect");
            Assert.AreEqual(languageFile[0][0], CELL_VALUE, "Row value is incorrect");

            languageFile.RemoveColumn(0);

            Assert.Throws(typeof(ArgumentOutOfRangeException), () => {
                languageFile[0][0] = CELL_VALUE;
            }, "Column not removed");

            languageFile.RemoveRow(0);

            Assert.Throws(typeof(ArgumentOutOfRangeException), () => {
                languageFile[0][0] = CELL_VALUE;
            }, "Row not removed");
        }