Exemplo n.º 1
0
        private void BtnRunTest_Click(object sender, EventArgs e)
        {
            Form _formToOpen;

            switch (_unitTest)
            {
            case UnitTests.VisualListViewExtended:
            {
                _formToOpen = new VisualListViewTest();
                break;
            }

            case UnitTests.VisualForm:
            {
                _formToOpen = new VisualForm("Empty VisualForm");
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException();
            }
            }

            _formToOpen.ShowDialog();
        }
Exemplo n.º 2
0
        private void BtnRunTest_Click(object sender, EventArgs e)
        {
            VisualForm _formToOpen;

            switch (_unitTest)
            {
            case UnitTests.VisualForm:
            {
                _formToOpen = new VisualForm($@"{nameof(VisualForm)} Test");
                _formToOpen.ShowDialog();
                break;
            }

            case UnitTests.VisualControlBox:
            {
                _formToOpen = new VisualControlBoxTest();
                _formToOpen.ShowDialog();
                break;
            }

            case UnitTests.VisualListView:
            {
                _formToOpen = new VisualListViewTest();
                _formToOpen.ShowDialog();
                break;
            }

            case UnitTests.VisualMessageBox:
            {
                _formToOpen = new VisualMessageBoxTest();
                _formToOpen.ShowDialog();
                break;
            }

            case UnitTests.VisualInputDialog:
            {
                VisualInputDialog inputDialog = new VisualInputDialog($@"{nameof(VisualInputDialog)} Test");

                if (inputDialog.ShowDialog() == DialogResult.OK)
                {
                    ConsoleEx.WriteDebug(inputDialog.InputResult);
                }

                break;
            }

            case UnitTests.VisualExceptionDialog:
            {
                VisualExceptionDialog.Show(new Exception("Your custom exception message."));
                break;
            }

            case UnitTests.VisualColorDialog:
            {
                VisualColorDialog colorDialog = new VisualColorDialog();

                if (colorDialog.ShowDialog() == DialogResult.OK)
                {
                    ConsoleEx.WriteDebug(colorDialog.Color);
                }

                break;
            }

            case UnitTests.ClipboardTest:
            {
                _formToOpen = new ClipboardTest();
                _formToOpen.ShowDialog();
                break;
            }

            default:
            {
                throw new ArgumentOutOfRangeException();
            }
            }
        }