private ValidationResult ValidationResult(AssessmentViewModel model) { var validator = new AssessmentViewModelValidator(_futureDateValidator); var result = validator.Validate(model); return(result); }
public void WhenClickOnCreateButton() { A.CallTo(() => _futureDateValidator.Valid(A <DateTime> ._)).Returns(true); var validator = new AssessmentViewModelValidator(_futureDateValidator); _validatorResult = validator.Validate(_assessmentModel); }
public void AssessmentViewModelValidator_AssessmentDateIsInTheFuture_ValidationShouldFail() { _futureDateValidator = A.Fake <IFutureDateValidator>(); A.CallTo(() => _futureDateValidator.Valid(A <DateTime> ._)).Returns(false); var model = new AssessmentViewModel() { DateAssessmentStarted = DateTime.Now.AddDays(1), Stage1DecisionToBeMade = "decision", Stage1DecisionClearlyMade = true }; var validator = new AssessmentViewModelValidator(_futureDateValidator); var result = validator.Validate(model); result.IsValid.Should().BeFalse(); }