コード例 #1
0
        private ValidationResult ValidationResult(AssessmentViewModel model)
        {
            var validator = new AssessmentViewModelValidator(_futureDateValidator);
            var result    = validator.Validate(model);

            return(result);
        }
コード例 #2
0
ファイル: NewAssessmentSteps.cs プロジェクト: SaBPNHS/MCATool
        public void WhenClickOnCreateButton()
        {
            A.CallTo(() => _futureDateValidator.Valid(A <DateTime> ._)).Returns(true);
            var validator = new AssessmentViewModelValidator(_futureDateValidator);

            _validatorResult = validator.Validate(_assessmentModel);
        }
コード例 #3
0
        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();
        }