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

GetCurrentStep() public method

Returns the step that the Wizard is currently on.
public GetCurrentStep ( ) : IWizardStep
return IWizardStep
        public virtual IWizardStep GetCurrentStep()
        {
//            if (CurrentStep == -1 && StepCount > 0) CurrentStep = 0;
            return CurrentStep < 0 ? null : WizardSteps[CurrentStep];
        }

Usage Example

 public void Test_CanMoveBack_WhenStepTrue_ShouldReturnTrue()
 {
     //---------------Set up test pack-------------------
     WizardController wizardController = new WizardController();
     var step1 = MockRepository.GenerateMock<IWizardStep>();
     step1.Stub(wizardStep1 => wizardStep1.CanMoveBack()).Return(true);
     wizardController.AddStep(step1);
     wizardController.GetFirstStep();
     //---------------Assert Precondition----------------
     Assert.AreEqual(1, wizardController.StepCount);
     step1.AssertWasNotCalled(step => step.CanMoveBack());
     Assert.AreSame(step1, wizardController.GetCurrentStep());
     //---------------Execute Test ----------------------
     var canMoveBack = wizardController.CanMoveBack();
     //---------------Test Result -----------------------
     step1.AssertWasCalled(wizardStep => wizardStep.CanMoveBack());
     Assert.AreEqual(step1.CanMoveBack(), canMoveBack);
     Assert.IsTrue(canMoveBack);
 }
All Usage Examples Of Habanero.Faces.Base.WizardController::GetCurrentStep