public void WizardNavigationwizardPage2AndSourceDataLocationTextBoxHasNoText()
        {
            using (var selectedPage = new AeroWizard.WizardPage())
            {
                selectedPage.Name = "wizardPage2";
                using (var pageContainer = new AeroWizard.WizardPageContainer())
                {
                    using (var folderPathValidationLabel = new System.Windows.Forms.Label())
                    {
                        using (var sourceDataLocationTextBox = new System.Windows.Forms.TextBox())
                        {
                            using (var systemUnderTest = new ImportWizard())
                            {
                                using (var tokenSource = new CancellationTokenSource())
                                {
                                    FluentActions.Invoking(() => systemUnderTest.WizardNavigation(folderPathValidationLabel, sourceDataLocationTextBox, selectedPage, pageContainer))
                                    .Should()
                                    .NotThrow();
                                }
                            }
                        }

                        folderPathValidationLabel.Visible.Should().BeTrue();
                    }
                }
            }
        }
        public void WizardNavigationwizardPage2AndSourceDataLocationTextBoxHasText()
        {
            using (var selectedPage = new AeroWizard.WizardPage())
            {
                selectedPage.Name = "wizardPage2";
                using (var pageContainer = new AeroWizard.WizardPageContainer())
                {
                    using (var folderPathValidationLabel = new System.Windows.Forms.Label())
                    {
                        using (var sourceDataLocationTextBox = new System.Windows.Forms.TextBox())
                        {
                            sourceDataLocationTextBox.Text = "Sample text";
                            using (var systemUnderTest = new ImportWizard())
                            {
                                using (var tokenSource = new CancellationTokenSource())
                                {
                                    FluentActions.Invoking(() => systemUnderTest.WizardNavigation(folderPathValidationLabel, sourceDataLocationTextBox, selectedPage, pageContainer))
                                    .Should()
                                    .Throw <NullReferenceException>()
                                    .WithMessage("Object reference not set to an instance of an object.");
                                }
                            }
                        }

                        folderPathValidationLabel.Visible.Should().BeFalse();
                    }
                }
            }
        }
示例#3
0
        public void WizardNavigation(System.Windows.Forms.Label folderPathValidationLabel, TextBox sourceDataLocationTextBox, AeroWizard.WizardPage selectedPage, AeroWizard.WizardPageContainer pageContainer)
        {
            if (selectedPage.Name == "wizardPage2")
            {
                ValidationHelpers.IsTextControlNotEmpty(folderPathValidationLabel, sourceDataLocationTextBox);

                if (!folderPathValidationLabel.Visible)
                {
                    pageContainer.NextPage();
                }
            }
            else if (!selectedPage.IsFinishPage)
            {
                pageContainer.NextPage();
            }
        }