Пример #1
0
        public void TestEmulateDelete()
        {
            FormsDataGridView dataGridview = new FormsDataGridView(testDlg["dataGridView"]());

            //行追加
            dataGridview.EmulateCellCheck(1, 0, true);
            dataGridview.EmulateCellCheck(1, 1, true);
            dataGridview.EmulateCellCheck(1, 2, true);

            //削除
            dataGridview.EmulateClearSelection();
            dataGridview.EmulateChangeRowSelected(new RowSelectedInfo(1, true));
            dataGridview.EmulateDelete();
            Assert.AreEqual(3, dataGridview.RowCount);

            //非同期
            dataGridview.EmulateClearSelection();
            dataGridview.EmulateChangeRowSelected(new RowSelectedInfo(1, true));
            app[GetType(), "UserDeletedRowEvent"](dataGridview.AppVar);
            dataGridview.EmulateDelete(new Async());
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            Assert.AreEqual(2, dataGridview.RowCount);

            //行クリア
            dataGridview["Rows"]()["Clear"]();
        }
Пример #2
0
        public void TestEmulateChangeRowSelectedSelectedRows2()
        {
            FormsDataGridView dataGridview = new FormsDataGridView(testDlg["dataGridView"]());

            //行追加
            dataGridview.EmulateCellCheck(1, 0, true);
            dataGridview.EmulateCellCheck(1, 1, true);
            dataGridview.EmulateCellCheck(1, 2, true);

            //行選択テスト
            dataGridview.EmulateClearSelection();
            dataGridview.EmulateChangeRowSelected(new RowSelectedInfo(1, true));
            dataGridview.EmulateChangeRowSelected(new RowSelectedInfo(2, true));
            AssertEx.AreEqual(new int[] { 1, 2 }, dataGridview.SelectedRows);

            //行クリア
            dataGridview["Rows"]()["Clear"]();
        }
Пример #3
0
        public void TestEmulateChangeRowSelectedSelectedRows()
        {
            FormsDataGridView dataGridview = new FormsDataGridView(testDlg["dataGridView"]());

            //行追加
            dataGridview.EmulateCellCheck(1, 0, true);
            dataGridview.EmulateCellCheck(1, 1, true);
            dataGridview.EmulateCellCheck(1, 2, true);

            //行選択テスト
            dataGridview.EmulateClearSelection();
            dataGridview.EmulateChangeRowSelected(new RowSelectedInfo(1, true), new RowSelectedInfo(2, true));
            AssertEx.AreEqual(new int[] { 1, 2 }, dataGridview.SelectedRows);

            //非同期
            app[GetType(), "SelectionChangedEvent"](dataGridview.AppVar);
            dataGridview.EmulateChangeRowSelected(new Async(), new RowSelectedInfo(1, false));
            new NativeMessageBox(testDlg.WaitForNextModal()).EmulateButtonClick("OK");
            AssertEx.AreEqual(new int[] { 2 }, dataGridview.SelectedRows);

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