public void GivenThreeStepWizard_CanAdvanceToLastStep() { var wiz = new WizardViewModel(); wiz.Advance(); wiz.Advance(); wiz.CurrentStepNumber.Should().Be(3); wiz.IsOnLastStep.Should().BeTrue(); }
public void GivenThreeStepWizard_CanAdvanceToSecondStep() { var wiz = new WizardViewModel(); wiz.Advance(); wiz.CurrentStepNumber.Should().Be(2); }
public void GivenThreeStepWizard_AfterAdvanceToSecondStep_ShouldNotBeFirstNorLast() { var wiz = new WizardViewModel(); wiz.Advance(); wiz.IsOnFirstStep.Should().BeFalse(); wiz.IsOnLastStep.Should().BeFalse(); }
public void GivenThreeStepWizard_CanGoBack() { var wiz = new WizardViewModel(); wiz.Advance(); wiz.GoBack(); wiz.CurrentStepNumber.Should().Be(1); }
public ActionResult Skip(WizardViewModel wizardViewModel) { if (!wizardViewModel.AllowSkipping) { throw new ArgumentException("not allowed to skip"); } wizardViewModel.Advance(); return(Json(new { wizardViewModel })); }
public JsonResult Next(WizardViewModel wizardViewModel) { if (wizardViewModel.SaveInProgress) { //TODO if save-in-progress, save data from wizard } wizardViewModel.Advance(); return(Json(new { wizardViewModel })); }