Exemple #1
0
        public void TestEmulateCellCheck()
        {
            FormsDataGridView dataGridview = new FormsDataGridView(testDlg["dataGridView"]());

            //チェック
            dataGridview.EmulateCellCheck(1, 0, true);
            Assert.AreEqual(true.ToString(), dataGridview.GetText(1, 0));

            //非同期
            app[GetType(), "CellEndEditEvent"](dataGridview.AppVar);
            dataGridview.EmulateCellCheck(1, 0, false, new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            Assert.AreEqual(false.ToString(), dataGridview.GetText(1, 0));

            //行クリア
            dataGridview["Rows"]()["Clear"]();
        }
Exemple #2
0
        public void TestEmulateChangeCellComboSelect()
        {
            FormsDataGridView dataGridview = new FormsDataGridView(testDlg["dataGridView"]());

            //テキスト変更
            dataGridview.EmulateChangeCellComboSelect(2, 0, 2);
            Assert.AreEqual("2", dataGridview.GetText(2, 0));

            //非同期
            app[GetType(), "CellEndEditEvent"](dataGridview.AppVar);
            dataGridview.EmulateChangeCellComboSelect(2, 0, 3, new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            Assert.AreEqual("3", dataGridview.GetText(2, 0));

            //行クリア
            dataGridview["Rows"]()["Clear"]();
        }
Exemple #3
0
        public void TestGetText()
        {
            FormsDataGridView dataGridview = new FormsDataGridView(testDlg["dataGridView"]());

            //テストデータ
            dataGridview.EmulateChangeCellText(0, 0, "a");
            dataGridview.EmulateChangeCellText(0, 1, "b");
            dataGridview.EmulateChangeCellText(0, 2, "c");
            dataGridview.EmulateCellCheck(1, 0, true);
            dataGridview.EmulateCellCheck(1, 2, true);

            Assert.AreEqual("b", dataGridview.GetText(0, 1));
            AssertEx.AreEqual(new string[][] { new string[] { "a", true.ToString() },
                                               new string[] { "b", string.Empty },
                                               new string[] { "c", true.ToString() } }, dataGridview.GetText(0, 0, 1, 2));

            //行クリア
            dataGridview["Rows"]()["Clear"]();
        }