コード例 #1
0
        public void EditPatientViewModelValidator_GivenNhsNumberIsProvided_ValidationShouldPass()
        {
            A.CallTo(() => _nhsValidator.Valid(A <decimal?> ._)).Returns(true);
            A.CallTo(() => _nhsValidator.Unique(A <decimal?> ._)).Returns(true);

            var model = new EditPatientViewModel()
            {
                ClinicalSystemId     = "PatientId",
                DateOfBirthViewModel = DateOfBirthViewModel(),
                FirstName            = "David",
                LastName             = "Miller",
                GenderId             = 1,
                NhsNumber            = 9434765870
            };

            var result = ValidationResult(model);

            result.IsValid.Should().BeTrue();
        }
コード例 #2
0
        public void Setup()
        {
            _futureDateValidator = A.Fake <IFutureDateValidator>();
            _clinicalIdValidator = A.Fake <IClinicalIdValidator>();
            _nhsValidator        = A.Fake <INhsValidator>();
            _clinicalSystemIdDescriptionProvider = A.Fake <IClinicalSystemIdDescriptionProvider>();

            A.CallTo(() => _clinicalIdValidator.Unique(A <string> ._)).Returns(true);
            A.CallTo(() => _futureDateValidator.Valid(A <DateTime?> ._)).Returns(true);
            A.CallTo(() => _nhsValidator.Valid(A <decimal?> ._)).Returns(true);
            A.CallTo(() => _nhsValidator.Unique(A <decimal?> ._)).Returns(true);
        }