Habanero.Faces.Base.WizardController.IsLastStep C# (CSharp) Method

IsLastStep() public method

Checks if the current step is the last step.
public IsLastStep ( ) : bool
return bool
        public virtual bool IsLastStep()
        {
            return (CurrentStep == StepCount - 1 && StepCount > 0);
        }

Usage Example

        public void Test_Finish_WhenNotLast_ShouldCallCurrentStepMoveOn()
        {
            //-----------------------Setup TestPack----------------------
            WizardController wizardController = new WizardController();

            IWizardStep step1 = MockRepository.GenerateMock<IWizardStep>();
            step1.Stub(wizardStep => wizardStep.CanFinish()).Return(true);
            wizardController.AddStep(step1);
            wizardController.AddStep(step1);

            wizardController.GetFirstStep();
            //------------------------Assert Precondition----------------
            Assert.AreSame(step1, wizardController.GetCurrentStep());
            Assert.IsFalse(wizardController.IsLastStep());
            Assert.IsTrue(wizardController.CanFinish(), "Should be able to finish this");
            step1.AssertWasNotCalled(step => step.MoveOn());
            //------------------------Execute----------------------------
            wizardController.Finish();
            //------------------------Verify Result ---------------------
            step1.AssertWasCalled(step => step.MoveOn());//Should now be able to call finish even when not last step
        }
All Usage Examples Of Habanero.Faces.Base.WizardController::IsLastStep