public void Wizard_AllowNavigationToStep_NoIndexCheck () { PokerWizard wizard = new PokerWizard (); Assert.IsTrue (wizard.PokerAllowNavigationToStep (0), "#A1-1"); Assert.IsTrue (wizard.PokerAllowNavigationToStep (10), "#A1-2"); Assert.IsTrue (wizard.PokerAllowNavigationToStep (-10), "#A1-3"); }
public void Wizard_AllowNavigationToStep () { PokerWizard wizard = new PokerWizard (); WizardStep step1 = new WizardStep (); step1.ID = "step1"; step1.StepType = WizardStepType.Start; WizardStep step2 = new WizardStep (); step2.ID = "step2"; step2.StepType = WizardStepType.Step; WizardStep step3 = new WizardStep (); step3.ID = "step3"; step3.StepType = WizardStepType.Finish; wizard.WizardSteps.Add (step1); wizard.WizardSteps.Add (step2); wizard.WizardSteps.Add (step3); wizard.ActiveStepIndex = 0; wizard.MoveTo (step3); object o = wizard.PokerSaveControlState (); wizard.PokerLoadControlState (o); bool result = wizard.PokerAllowNavigationToStep (2); Assert.AreEqual (true, result, "AllowNavigationToStep#1"); step3.AllowReturn = false; result = wizard.PokerAllowNavigationToStep (2); Assert.AreEqual (false, result, "AllowNavigationToStep#2"); }