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

UndoCompleteCurrentStep() public method

Undoes any actions that have been done by the current step when you move back to the previous step. It does this by calling the wizard step moveback
public UndoCompleteCurrentStep ( ) : void
return void
        public void UndoCompleteCurrentStep()
        {
            CheckWizardStep();
            GetCurrentStep().UndoMoveOn();
        }

Usage Example

 public void Test_UndoCurrentStep_ShouldCallStepMoveBack()
 {
     //---------------Set up test pack-------------------
     WizardController wizardController = new WizardController();
     var step1 = MockRepository.GenerateMock<IWizardStep>();
     wizardController.AddStep(step1);
     wizardController.GetFirstStep();
     //---------------Assert Precondition----------------
     Assert.AreEqual(1, wizardController.StepCount);
     step1.AssertWasNotCalled(step => step.UndoMoveOn());
     Assert.AreSame(step1, wizardController.GetCurrentStep());
     //---------------Execute Test ----------------------
     wizardController.UndoCompleteCurrentStep();
     //---------------Test Result -----------------------
     step1.AssertWasCalled(wizardStep => wizardStep.UndoMoveOn());
 }